fix(run-engine,core): non-blocking test polls and document the zero total limit
The waitFor polls dequeued with the default 10s blocking pop, which could blow past the helper deadline on a slow runner; poll non-blocking instead. Document that totalConcurrencyLimit: 0 holds every keyed run, matching concurrencyLimit's zero semantics.
This commit is contained in:
@@ -286,7 +286,9 @@ describe("RunQueue total concurrency limit", () => {
|
||||
});
|
||||
|
||||
const r1Admitted = await waitFor(async () => {
|
||||
const next = await queue.dequeueMessageFromWorkerQueue("consumer-1", "main");
|
||||
const next = await queue.dequeueMessageFromWorkerQueue("consumer-1", "main", {
|
||||
blockingPop: false,
|
||||
});
|
||||
return next?.messageId === "r1";
|
||||
});
|
||||
expect(r1Admitted).toBe(true);
|
||||
@@ -350,7 +352,9 @@ describe("RunQueue total concurrency limit", () => {
|
||||
});
|
||||
|
||||
const r1Admitted = await waitFor(async () => {
|
||||
const next = await queue.dequeueMessageFromWorkerQueue("consumer-1", "main");
|
||||
const next = await queue.dequeueMessageFromWorkerQueue("consumer-1", "main", {
|
||||
blockingPop: false,
|
||||
});
|
||||
return next?.messageId === "r1";
|
||||
});
|
||||
expect(r1Admitted).toBe(true);
|
||||
|
||||
@@ -54,6 +54,9 @@ export type QueueOptions = {
|
||||
* ```
|
||||
*
|
||||
* Only enforced for runs triggered with a `concurrencyKey`, and requires server-side support.
|
||||
*
|
||||
* Omit for no total cap. Like `concurrencyLimit`, a value of `0` holds every keyed run in
|
||||
* the queue rather than removing the cap.
|
||||
*/
|
||||
totalConcurrencyLimit?: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user