Repository navigation
test(node): wait out ETXTBSY on the fake git in the re-probe test - #593
Open
beardthelion wants to merge 1 commit into
Open
beardthelion wants to merge 1 commit into
beardthelion wants to merge 1 commit into
Conversation
absent_probe_still_reprobes_when_the_budget_allows writes a fake git script and execs it straight away. A concurrent test thread that forks while the script's write descriptor is open hands the child a copy until it execs, so the exec fails with Text file busy. The probe maps that to a Transient spawn error and the test sees zero spawns instead of two. Exec the fake until it stops returning ETXTBSY, then clear the log that run wrote. With 8 threads forking in the background the unpatched test failed 3 of 100 runs, all with Text file busy (os error 26); patched, 0 of 300.
Contributor
This branch has not been deployed
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.
Summary
absent_probe_still_reprobes_when_the_budget_allowsnow waits out a transient ETXTBSY on its freshly written fakegitbefore running the probe it tests.Motivation & context
The test writes a fake
gitscript and execs it immediately. If another test thread forks while the script's write descriptor is open, the child holds a copy until it execs, and the first exec fails with "Text file busy".batch_check_probemaps that toTransient("failed to spawn git cat-file"), so the fake never runs and the test sees zero spawns instead of two (left: 0, right: 2). That is the failure in CI job 132007293693.smart_http.rsalready retries around the same race for its fake-git tests; this one had no guard.Kind of change
What changed
gitlawb-node: add a test helperwait_until_fake_execsingit/store.rsthat execs the fake until it stops returning ETXTBSY. The test calls it afterchmodand deletes the log that run wrote before probing.How a reviewer can verify
cargo test --locked -p gitlawb-node --lib git::store::testsThis passes with or without the change on an idle machine. The race needs other threads forking while the fake is written. With 8 threads forking in the background (temporary code, not in this PR), the unpatched test failed 3 of 100 runs, every one with
Text file busy (os error 26)and the sameleft: 0, right: 2. Patched, it passed 300 of 300 under the same pressure.Before you request review
cargo test --workspacepasses locallycargo fmt --allandcargo clippy --workspace --all-targets -- -D warningsare cleanfeat(...),fix(...),docs(...)).env.exampleupdated if behavior or config changed (or N/A)Protocol & signing impact
did:key, Ed25519 / RFC 9421 signatures, UCAN, ref certs, or P2P wire formatsNone of these apply: the change is inside a test module and touches no protocol code.
Notes for reviewers
The full workspace tests were not run on this branch; I ran
git::store::tests(30 passed) and clippy with-D warningsongitlawb-nodeonly. The checkbox for new tests is unticked because this change fixes a test and adds no behavior; the fork-pressure runs above are the evidence.The failure was reproduced with synthetic fork pressure, not captured from a CI runner, so the link to the CI failure rests on the matching assertion values and the Text file busy error.
Other fixtures in
store.rswrite and exec a fake the same way and can hit the same race. I left them alone. Separately,absent_probe_skips_a_reprobe_it_cannot_affordfailed once in my load runs for a different reason: it burns 0.9s of a 1s budget and overshot to 2.05s.Summary by CodeRabbit