Commit 9a7e82b
committed
fix(cli): bound the snapshot waits, so no verb can hang without an exit code
The server `test` job kept dying at its 15-minute cap, and with the per-test
timeout in place it finally named itself: `src/cli/wait.test.ts` times out right
after its three argv-only tests — i.e. on the first test that actually connects.
It reproduces on the runner every time and on nothing else: the suite passes on
macOS/Node 26, on Node 22 at concurrency 2, and in `node:22` under Docker at both
`--cpus=2` and `--cpus=4` (1623 tests, exit 0). Two hypotheses died on the way
here: forcing the stub's sockets shut did not fix it, and RSA keygen is not the
cost (a 2048-bit `selfsigned.generate` measures 1ms, four concurrently still 0s).
What the investigation did expose is a real defect of the same family as the two
already fixed on this branch: `awaitSnapshot()` / `awaitProjects()` reject when
the socket *closes*, but a server that stays up and simply never pushes was
waited on **forever**. That keeps the socket open and the event loop alive, so
the verb produces no output and no exit code — the one outcome D8's contract
cannot express, and precisely how a CI job ends up cancelled minutes later with
nothing naming the cause. `ls`, `new`, `run`, `fork`, `ask` and `wait` all await
a snapshot before doing anything, so all six inherited it.
Both waits are now bounded at 15s and reject with a sentence. The server pushes
both snapshots immediately after `hello.ack`, so this can only fire when
something is genuinely wrong; the timer is unref'd so it can never itself be the
reason a process stays alive.
Verified: server 1624/1624 on Node 26 and the stub-heavy files 66/66 on Node 22
(CI's version). Whether this is the runner's exact stall or not, the class of
failure it removes is the one that was killing the job blind.1 parent 6c4cb7f commit 9a7e82b
4 files changed
Lines changed: 64 additions & 3 deletions
File tree
- .pnpm-store/v11
- projects
- server/src/cli
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | | - | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
123 | 154 | | |
124 | 155 | | |
125 | 156 | | |
| |||
242 | 273 | | |
243 | 274 | | |
244 | 275 | | |
| 276 | + | |
245 | 277 | | |
246 | 278 | | |
247 | 279 | | |
248 | 280 | | |
249 | 281 | | |
250 | 282 | | |
251 | 283 | | |
| 284 | + | |
252 | 285 | | |
253 | 286 | | |
254 | 287 | | |
| |||
0 commit comments