Commit b90986c
committed
test(cli): judge the closed-read-end case by exit status, not a wall clock
`run-dev-unbuilt-workspace.e2e.test.ts` case 6 asserted
`closedEnd.elapsedMs < STALL_MS` — a fixed wall-clock bound borrowed from
case 4's parent stall, against a term that is entirely elastic. Tracing what
produces that timing shows the bound was not merely fragile, it was a phantom.
With the read end destroyed, oclif's `displayWarnings()` makes the first
stderr write, the pipe is already gone, node raises `write EPIPE` as an
`error` event on `process.stderr`, nothing is listening, and the child dies
of an uncaught exception at ~1.4 s with exit 1. `writeStderr()` is never
reached, so the bound the case was named after is never armed. Traced with a
`--import` observer: the shim's own 415-byte write is #175 at 9250 ms, behind
174 oclif writes that all EPIPE — 7.8 s after the real child is already dead.
Ablated on `bin/run-dev.js`, same box, same probe (old bound's verdict in
brackets): pristine exit 1 at 1387-1711 ms [green]; write callback removed so
a closed path could only finish on the bound, which is the regression this
case named, exit 1 at 1517-1633 ms [GREEN]; EPIPE made non-fatal, exit 2 at
8787-8979 ms [green, 1.2 s spare]; both, so the path really pays the bound,
exit 2 at 23601-23712 ms [red]. The measurement moved only where the exit
code moved too, and it stayed green on its own regression.
So the exit status is the observation the wall clock was standing in for, and
it carries no load term: 1 means the child died on its first write, 2 means it
reached `handle()`, which is only reachable through `writeStderr()`. This
asserts that directly and keeps the elapsed reading as evidence in the failure
message, the same split #14715 made for case 5.
Exit 1 is what the CLI does rather than what anyone contracted — filed as
#14858, and pinning today's value is what stops that changing silently.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016yfqQh2dBgPAymYd7xipza1 parent f3ae441 commit b90986c
1 file changed
Lines changed: 58 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 166 | + | |
169 | 167 | | |
170 | 168 | | |
171 | 169 | | |
| |||
457 | 455 | | |
458 | 456 | | |
459 | 457 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
467 | 513 | | |
468 | 514 | | |
0 commit comments