Repository navigation
Commit 07b9758
fix(tests): reap the recovery proxy instead of trusting
The update-recovery case starts a real detached proxy, and its cleanup ran the
reap only when `node ocx.mjs stop` exited non-zero. That exit code is a claim,
not proof: `stop` also reports success when it finds no live runtime to stop,
which is indistinguishable here from one it failed to stop. On that path nothing
killed the proxy, and the block went straight on to `rmSync` the fixture tree.
The survivor was reparented to init with its package tree, `src` symlink, and
config deleted underneath it — unable to serve, unable to exit. One escapee sat
at 99% of a core for three and a half hours, 202 minutes of CPU time, listening
on nothing. It also held the test machine lock, which is how it surfaced.
Cleanup now resolves the pid before anything destroys the record of it, runs
`stop` for its graceful path, then verifies liveness and reaps regardless of what
`stop` claimed. `rmSync` moves inside a nested finally so it still always runs,
but strictly after the reap: deleting the tree out from under a live detached
process is what turned a missed kill into a permanently spinning orphan. Reaping
the recorded pid is enough because bin/ocx.mjs mirrors its Bun child's exit, so
the node launcher follows it down.
Reaping alone would still fail silently, because the case passed the whole time
it was leaking. An afterAll now audits the pid, so a future regression is red
instead of invisible. Verified by A/B: with `stop` stubbed to exit 0 without
killing, the old cleanup reports 15 pass / 0 fail and leaves the orphan, the new
one reports 15 pass / 0 fail and leaves nothing, and the old cleanup under the
new guard turns red.
Co-Authored-By: Claude Opus 5 <[email protected]>stop
1 parent a57b962 commit 07b9758
1 file changed
Lines changed: 46 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
244 | 270 | | |
245 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
246 | 275 | | |
247 | | - | |
248 | 276 | | |
249 | 277 | | |
250 | 278 | | |
| |||
0 commit comments