Skip to content

test: give the command cleanup tests room on a busy CI runner - #142

Merged
Seb-GRAF merged 1 commit into
mainfrom
test/command-timing-bounds
Oct 21, 2026
Merged

Seb-GRAF merged 1 commit into
mainfrom
test/command-timing-bounds

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

Four tests that spawn a shell expect their command to end within 2 seconds. On CI they sometimes take 2.1 to 2.3 seconds and fail, even though nothing is wrong:

Locally all four finish in 0.04 to 0.31 seconds. On CI, Swift Testing runs them beside the native rendering tests, and spawning the shell waits for the busy runner. This is the same kind of failure that f09c14c fixed for the main-actor timing tests.

Changes

commandOutputHasABoundedSize, cancellingOrTimingOutStopsShellChildren, commandTimeoutClosesPipesHeldByChildrenAfterTheShellExits and exitingStreamStopsChildrenHoldingItsPipes now expect their command to end within 5 seconds instead of 2.

Each limit only has to tell a prompt end from a regression that waits for the 10-second default command timeout or a child's sleep 30, so 5 seconds still catches one.

I left cancellingAWidgetStopsItsRunningCommand at 2 seconds. Its command is sleep 5, so a 5-second limit could no longer tell cancellation from the sleep finishing, and it hasn't failed in the runs I checked.

Testing

  • swift test --filter on the four tests: all pass, in 0.04 to 0.31 seconds.
  • I can't reproduce the CI load locally; this PR's own CI run is the check.
  • git diff --check and commitlint pass.

Merging

One commit. Any merge method works; the title matches the commit message. A test: commit makes no release.

Claude Opus 5.5 via Claude Code in T3 Code.

Four tests that spawn a shell expected their command to end within
2 seconds. Locally they take under half a second, but on CI, where
Swift Testing runs them beside the native rendering tests, they took
2.1 to 2.3 seconds and failed on main and in pull requests.

The limit only has to tell a prompt end from one that waits for the
10-second command timeout or a 30-second sleep, so 5 seconds still
catches a regression.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 21, 2026 10:56
@Seb-GRAF
Seb-GRAF merged commit a757501 into main Oct 21, 2026
4 checks passed
@Seb-GRAF
Seb-GRAF deleted the test/command-timing-bounds branch October 21, 2026 13:40
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants