[codex] Stabilize ccusage timeout cleanup test#501
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the Unix-only ccusage_timeout_kills_descendant_and_closes_pipes test in src-tauri by reducing timing flakiness while keeping production timeout/kill behavior unchanged.
Changes:
- Add a small retry loop helper to wait for
descendant.pidto appear before parsing it. - Increase the fake runner timeout budget from 100ms to 1s, while still exercising the timeout path and verifying cleanup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
406776c to
beb1dd4
Compare
robinebers
left a comment
There was a problem hiding this comment.
LGTM — clean fix for the test race. Bumping the runner budget to 1s and adding the pid-file poll loop keeps the timeout path exercised without depending on sub-100ms shell startup. No production code touched.
Summary
ccusage_timeout_kills_descendant_and_closes_pipeswait for the descendant pid file with a short retry loopdescendant.pidbefore the timeout kill path runsWhy
The test was racing its own setup. On a slower or busy machine, the 100ms timeout can kill the fake shell runner before it reaches:
When that happens, the assertion fails with:
The test is meant to verify timeout cleanup of descendant processes and pipe draining, not whether a shell script can always initialize in under 100ms. The new version still exercises the timeout path, keeps the cleanup hang guard, and then verifies that the descendant is killed.
Validation
cargo test plugin_engine::host_api::tests::ccusage_timeout_kills_descendant_and_closes_pipes -- --nocapturecargo testSummary by cubic
Stabilizes the
ccusage_timeout_kills_descendant_and_closes_pipestest to remove timing flakiness on slower machines while keeping production timeout/kill behavior unchanged.descendant.pidwith a 20ms interval and 1s deadline before asserting.Written for commit bbc999a. Summary will update on new commits. Review in cubic