Repository navigation
test(node): wait out ETXTBSY in the filtered-pack admission test - #595
Open
beardthelion wants to merge 1 commit into
Open
beardthelion wants to merge 1 commit into
beardthelion wants to merge 1 commit into
Conversation
build_filtered_pack_holds_admission_through_rev_list_reap_on_disconnect writes a fake git and starts build_filtered_pack at once. A concurrent test thread that forks while the script's write descriptor is open hands the child a copy until it execs, so the first exec fails with Text file busy and the future completes early with that error. The test's polling loop then polls the finished future again and panics with 'async fn resumed after completion', which hides the cause. Exec the fake with an argument that hits its no-op branch until it stops returning ETXTBSY. With 8 threads forking in the background the unpatched test failed 4 of 80 runs, each with Text file busy (os error 26) at the early completion; patched, it passed 300 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
build_filtered_pack_holds_admission_through_rev_list_reap_on_disconnectnow waits out a transient ETXTBSY on its freshly written fakegitbefore it startsbuild_filtered_pack.Motivation & context
The test writes a fake
gitscript and starts the build at once. 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". The future then completes early with that error. The test's polling loop polls the finished future again and panics with "async fnresumed after completion", which hides the cause. I saw that panic once in a loaded local run.Kind of change
What changed
gitlawb-node: ingit/smart_http.rs, a test helperwait_until_fake_execsexecs the fake with an argument that hits its no-op branch until ETXTBSY stops. The test calls it once after writing the fake.How a reviewer can verify
cargo test --locked -p gitlawb-node --lib git::smart_http::tests::build_filtered_pack_holds_admission_through_rev_list_reap_on_disconnectThis 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 4 of 80 runs, each with
Err(Text file busy (os error 26))at the early completion. 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
I did not run the full workspace tests on this branch. I ran the
git::smart_http::testsmodule (all passing),cargo fmt --all -- --check, and clippy with-D warningsongitlawb-nodeonly, so the clippy box is unticked. The new-tests box is unticked because this changes a test and adds no behavior.The failure was reproduced with synthetic fork pressure, not captured from CI, so the link to the CI-style panic rests on the error text and the matching early completion.
The drop test elsewhere in this module has the same re-poll shape. It already retries around the same race, so I left it alone.
Summary by CodeRabbit