Skip to content

Commit 9579fbc

Browse files
fix: increase processWorkerQueueDebounceMs in priority test to prevent race condition
With PrismaPg adapter overhead, each trigger() call takes longer than with the old Rust engine. A 50ms processWorkerQueueDebounceMs causes the background processQueueForWorkerQueue job to fire between individual triggers, moving items to the worker queue one-by-one in arrival (FIFO) order instead of waiting for all items to be in the master queue and moving them collectively in priority order. Increase to 10s so the test's manual processMasterQueueForEnvironment call controls the ordering. Co-Authored-By: Eric Allam <eallam@icloud.com>
1 parent d00e5ca commit 9579fbc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal-packages/run-engine/src/engine/tests/priority.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ describe("RunEngine priority", () => {
2727
},
2828
queue: {
2929
redis: redisOptions,
30-
processWorkerQueueDebounceMs: 50,
30+
// Use a large debounce so the background processQueueForWorkerQueue job
31+
// doesn't race with the manual processMasterQueueForEnvironment call.
32+
// With PrismaPg adapter overhead each trigger() takes longer, so a small
33+
// debounce causes items to be moved to the worker queue individually in
34+
// arrival order rather than collectively in priority order.
35+
processWorkerQueueDebounceMs: 10_000,
3136
masterQueueConsumersDisabled: true,
3237
},
3338
runLock: {

0 commit comments

Comments
 (0)