Repository navigation
ci(cmux-next): the swift test wrapper reads its log only once tee has written it (bash 3.2) - #23402
Conversation
…it (red on bash 3.2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
…en it bash 3.2 cannot wait for a process substitution, so wait returned at once and the report could read the log while tee was still writing it (an empty or cut log: no reds named, or a run with its summary read as ended early). The wrapper now watches tee's pid end, up to 10 s, when wait cannot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
|
|
Owned by browser-import-2 on cosmic-gray · session |
1 similar comment
|
Owned by browser-import-2 on cosmic-gray · session |
|
Bead |
|
Review (independent subagent): SHIP at 27c7140
|
|
Red attribution before merging, at head 27c7140. All three failing jobs also fail on base:
|
|
base-red-watch: |
|
Shipped in:
|
What
A second race in
swift-test-with-hang-sampler.sh, beside the one #23290 fixes. The wrapper reads its log right after closingtee's input:bash 3.2, macOS's
/bin/bash, cannot wait for a process substitution.waitreturns 127 at once whileteeis still writing. The report then reads an empty or cut log, which shows up in two ways:Measured: a probe reads 0 of 2 lines on bash 3.2 and 2 of 2 on bash 5.3. bash 5 (the Linux CI runners) waits correctly, so this only hits macOS runs of the wrapper.
Not this PR: the #23366 flake itself (
swift-test-log.*: No such file) is #23290's. The watcher subshell inherits the wrapper's EXIT trap and deletes the log when it is killed early. The two PRs change different lines and merge cleanly.Fix
When
waitcan't wait, the wrapper pollskill -0ontee's pid until it is gone, for at most 10 s, and only then reads the log.Tests
swift-test-summary.test.shgains a case with ateethat writes late: it buffers its input and writes 1 s after the input closes. The red run must still name its red test./bin/bash3.2 with "a late-written log was read before its writer finished".Other
scripts/**/tests/*.test.shwith the same patterns:>(tee …)inscripts/.RUNNER_TEMP, onlypackage-test-lane-suite-args.test.shleavesRUNNER_TEMPunset. Its refusals exit before the lane touches it. No other changes needed.No capture: CI script, no UI.
Agent session: cosmic-gray
🤖 Generated with Claude Code