You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TaskService > waitForWorkspaceTurn handles completion racing with waiter registration (src/node/services/taskService.test.ts) fails intermittently in the full make test-unit run. It fails with:
error: Timed out waiting for workspace turn
at <anonymous> (src/node/services/workspaceTurnManager.ts:2683:38)
(fail) TaskService > waitForWorkspaceTurn handles completion racing with waiter registration [108.00ms]
Evidence
Full-suite run on 2026-09-23: Bun 1.3.5, Linux x64, BUN_JSC_useWasmIPInt=0, stock GIT_TEMPLATE_DIR. Result: 20,108 pass, 9 skip, 1 fail. This test was the only failure.
The same test passed 3/3 when run in isolation (bun test src/node/services/taskService.test.ts -t "waitForWorkspaceTurn handles completion racing").
The failure took about 100 ms, which suggests the test passes a very short timeoutMs. waitForWorkspaceTurn arms that timer before its asynchronous getWorkspaceTurn read settles. Under full-suite load (event loop and I/O contention), the timer can fire before the completion or record read is observed, so the test measures scheduling latency instead of the race it intends to cover. A deterministic fix would synchronize on the completion/registration signal rather than a wall-clock timeout.
Acceptance
The test deterministically exercises the completion-vs-registration race without depending on a short wall-clock timeout.
The test is stable under load, for example bun test --rerun-each=50 on the file and a full make test-unit.
Product behavior changes only if a real race in waitForWorkspaceTurn is found.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $255.89
Summary
TaskService > waitForWorkspaceTurn handles completion racing with waiter registration(src/node/services/taskService.test.ts) fails intermittently in the fullmake test-unitrun. It fails with:Evidence
BUN_JSC_useWasmIPInt=0, stockGIT_TEMPLATE_DIR. Result: 20,108 pass, 9 skip, 1 fail. This test was the only failure.bun test src/node/services/taskService.test.ts -t "waitForWorkspaceTurn handles completion racing").taskService.tsorworkspaceTurnManager.ts.Suspected cause (unverified)
The failure took about 100 ms, which suggests the test passes a very short
timeoutMs.waitForWorkspaceTurnarms that timer before its asynchronousgetWorkspaceTurnread settles. Under full-suite load (event loop and I/O contention), the timer can fire before the completion or record read is observed, so the test measures scheduling latency instead of the race it intends to cover. A deterministic fix would synchronize on the completion/registration signal rather than a wall-clock timeout.Acceptance
bun test --rerun-each=50on the file and a fullmake test-unit.waitForWorkspaceTurnis found.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$255.89