fix(codex-app-server): deflake darwin-parallel test races - #318
Open
schickling wants to merge 1 commit into
Open
fix(codex-app-server): deflake darwin-parallel test races#318schickling wants to merge 1 commit into
schickling wants to merge 1 commit into
Conversation
Two lib tests failed intermittently under full-suite parallel load on macOS while passing deterministically in isolation (#315): - process_group_cleanup_reaps_a_native_launcher_descendant: the shell redirection creates the pidfile before the pid bytes land, so reading immediately after is_file() observed an empty file and panicked with ParseIntError { kind: Empty }. Wait for parseable content within a bounded deadline instead of a single read. - subscribed_control_pump_delivers_a_typed_reference_to_the_real_fifo_head: asserted delivery-state == Accepted immediately after joining the pump, but the pump's final websocket frames race the fake server's exit under load, so it could exit before persisting Accepted. Poll for the outcome (bounded), bail early if the pump dies, then join and assert. No production changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #315
Problem
Two
codex_app_serverlib tests fail intermittently under full-suite parallel load on macOS arm64 while passing deterministically in isolation (rate table + panics in #315):process_group_cleanup_reaps_a_native_launcher_descendant→ParseIntError { kind: Empty }subscribed_control_pump_delivers_a_typed_reference_to_the_real_fifo_head→Attempted != AcceptedBaseline on
main(d29c37f2), five full-suite runs across two days: 3 of 5 failed, always exactly one of these tests.Root causes
printf "%s" "$$" > pidfile: the file is created before the bytes land. The test waited foris_file()then read once — an empty read under load panics on parse.delivery-state == Acceptedimmediately after joining pump and fake-server threads. The pump persists Accepted synchronously, but its final websocket frames race the fake server's exit under descheduling, so the pump can terminate before processingitem/completed.Fix (tests only, no production changes)
Verification
macOS arm64, fix commit, three consecutive full-suite runs:
Linux x86_64:
cargo test -p st2 --lib→ 355 passed; 0 failed.Isolation loops post-fix: both targets 10/10 pass.
Complexity
Test-only; ~20 lines across two tests, no new abstractions.