Commit 571f8a4
committed
fix(test): queue full-suite runs instead of warning about the contention
The contention warning was not enough. It scrolls past, the run starts
anyway, and nothing prevents the next agent from doing the same: four
concurrent suites drove load average to 10 and stretched a ~210s run past
13 minutes, which reads as a hang rather than as CPU starvation. The
detection was already here and already correct -- it just did not act.
`bun run test` now waits for the other runners to finish before starting.
Agents working in parallel worktrees each believe they are the only
runner, so the serialization has to live in the runner rather than in
anyone's discipline.
Queueing rather than refusing is deliberate. A hard failure invites
`bun test ./tests/` directly, which bypasses this file entirely and puts
the contention right back. Waiting is the behavior that survives being
worked around.
Two escape hatches keep it from becoming its own hang: `OCX_TEST_NO_QUEUE=1`
for anyone who genuinely wants overlap, and a 45-minute ceiling after
which a holder is presumed wedged and this run proceeds regardless.
Verified both directions: with a competing runner present the suite waits
and starts nothing (20s observed, no test output), and with the opt-out
set the same invocation runs immediately (1 pass).1 parent 95d8ed7 commit 571f8a4
1 file changed
Lines changed: 49 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
67 | 115 | | |
68 | 116 | | |
69 | 117 | | |
70 | 118 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 119 | + | |
79 | 120 | | |
80 | 121 | | |
81 | 122 | | |
| |||
0 commit comments