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
test(cli): make the #4873 exit-code pin deterministic — literal duration, no wall clock (#6266)
The case read the duration off a live `createTimer()`:
const durationMs = timer.elapsed() + 531;
expect(durationMs & 0xff).toBe(19);
which holds only while `elapsed()` returns exactly 0 — and an
`await emitJson(...)` sits between the two statements. One millisecond
turns 531 into 532 and `& 0xff` from 19 into 20, the exact number CI
reported. The clock supplied a failure mode and no coverage: neither the
type rejection nor Node's 8-bit truncation is a function of how long
anything took.
The duration is now the literal 531. The guard keeps bearing load — both
`@ts-expect-error` directives are untouched, and the runtime half still
asserts that the duration reaches the exit-code slot verbatim; the
truncation line is joined by an explicit statement of why 19 is a defect
(it is not one of the two codes `CliExitCode` defines).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uFVNMmTxLpmfQYiuKM1Yx
0 commit comments