Fix the flaky crash-report case in swift-test-summary.test.sh
The "test helper dies on a signal" case in scripts/cmux-next/tests/swift-test-summary.test.sh flakes in two ways. This PR fixes both in the test only; the sampler script is unchanged.
- The sampler's log vanished on CI. On #23076's Linux CI (job 119082777090) the check printed "no crash ::error line". Its log shows
awk: fatal: cannot open file /tmp/swift-test-log.RQ7ALWandsed: can't readthe same file: the sampler'smktemplog in the shared/tmpwas gone before the report step read it. Without the log it never saw the signal line, so it printed no crash error at all. The check runs beside many others underscripts/ci/run-checks-concurrently.sh. I did not find what deletes the file. The test now gives every sampler runTMPDIR=$TMP/tmp, so the log lives in the test's own temp dir. - A whole-second mtime race (macOS, locally). The sampler records
started_at=$(date +%s), andips-crash-summary.pyskips reports with mtime below it. A report written at second X.9 with a run start at X+1 counts as from before the run, and the test fails with "the crash error does not name the crashed thread's test frame". The test now sets the fresh report's mtime 60 s ahead withpython3 os.utime; nothing in the test sorts by mtime or bounds it from above. The old-reporttouch -t 202001010000line is unchanged.
Review (claude-review-subagent) at c55857b found that change 2 alone could not cause the CI failure above; change 1 is the response.
Changelog
none
Observed / Not run
- Observed (macOS, this Mac, 2 = only the mtime change): 15/15 passed. Base: 14/15 in the same loop, and 1 of 3 on an untouched tree, both with the frame message.
- Observed (macOS, with both changes at 9093e36): 86 of 87 runs passed. The output of the one failure was not kept, so I don't know its cause.
- Not reproduced: the CI deletion of the sampler log. Change 1 removes the shared
/tmpfrom the path; whether it fully stops the CI flake shows only on CI over time. - Observed:
python3 scripts/cmux-next/prepush-gate.pyreported no new violations.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the flaky "test helper dies on a signal" case in scripts/cmux-next/tests/swift-test-summary.test.sh where a fresh crash report was sometimes skipped as too old.
The run wrapper records started_at in whole seconds; a report written at second X.9 followed by a start at X+1 is read as predating the run, so ips-crash-summary.py skips it. The test now sets the report's mtime 60 seconds ahead via python3 os.utime, leaving the script's skip rule unchanged. python3 is used instead of date -v/date -d since the test runs on both macOS and Linux.