Repository navigation
runner: tests check the Runner's order and the ends it counts (P1R-C04 follow-up) - #106
Merged
Merged
Conversation
The macOS stage of main CI after #105 failed once in the Runner's DevGuard tests, and its re-run passed. Looping those tests here found one that fails about 1 run in 25, and 43 runs in 120 with 8 at a time: an_independent_runner_answers_registration_before_the_next_claim compared the moments two test tasks read the registration's answer and the next Claim's answer, while the Runner only orders its writes. It now takes the Claim's answer first and checks that the registration's answer is already waiting on the first connection. Five tests that #105 added or changed took a process's exit for its end. The Runner counts a process as ended once its output ended too: that starts its retention, makes an acknowledgement count and numbers its exit event. The output can end later, when a child that another test spawns holds the pipe until its exec, which is slow on macOS for a new executable. The retention tests now wait for the end of the output, and the two Claim tests wait until the Runner numbered the exit. Only tests change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7 of 8 tasks
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.
Issue
Part of #101: a follow-up to #105 (P1R-C04). This PR does not close an issue.
mainat385e177, with P1R-C04 merged41db94c6e7e065; both unchangedSummary
Before: after #105 merged, main CI run 38708302887 failed once in the macOS stage, in
cargo test -p codespace-runner --features devguard --lib -- registration wire admission launch independent lifecycle. Its one re-run passed. The job log does not name the failing test (the stage's output is only in the run's artifact).After: the two kinds of test that can fail that way now check what the Runner actually orders and counts. Only tests change.
wire::tests::registration::an_independent_runner_answers_registration_before_the_next_claim(registered_at <= claimed_at). With 8 copies at a time it failed 43 of 120 runs. The test compared the moments two test tasks read two answers on two connections. The Runner orders only its writes: it answers the registration, lets go of control, then grants the next Claim. The test now reads the Claim's answer first and checks, withFIONREAD, that the registration's answer already waits on the first connection.descriptors.rs). The retention tests now wait for the end of the output, and the two Claim tests wait until the Runner numbered the exit.Which test failed on macOS is not known. Of these, only the registration test failed in the loops here.
Contract changes
None. Only tests change.
Tests
sleep(not committed), main's testsdrops_the_oldest…(3 slots occupied),keeps_an_ended_process…(1 slot occupied),evicts_an_acknowledged…(still found after the retention time),a_lost_connection…(events_through0, not 1)Verified here (Linux, root, cloud):
cargo fmt --check; clippy-D warningson the root workspace, and oncodespace-runnerwith and withoutdevguard, all targets.codespace-runner --libwith the worker, patch and Linux sandbox helpers: 152 passed in 5 runs. A first run right after the build failed once inprocess::tests::a_failing_observer_does_not_hold_the_child(its 1 s bound); this PR does not touch that test.codespace-runner --features devguard --lib: 193 passed, with the known root-onlylaunch::tests::nothing_is_committed_when_the_owner_cannot_launchskipped.Not verified here: hosted macOS (this PR's CI runs it).
Security scenarios
No product code changes. The new test helper reads a socket's unread byte count with
ioctl(FIONREAD)in the test process only.Out of scope
process::tests::a_failing_observer_does_not_hold_the_child.