test(net-proxy): serialize fenced_child on net_test_lock() (#207)#218
Merged
Conversation
fenced_child_reaches_allowed_via_proxy_denied_refused_direct_kernel_blocked was the only loopback-exercising test in the net_proxy module that did not take the module's net_test_lock() serialization guard. It is also the heaviest net test — it spawns a loopback origin, a proxy, and a real curl child — so running it concurrently with a sibling proxy test raced on loopback and flaked CI (observed as "Empty reply from server" on the allow-leg in PR #195's macOS CI). Acquire net_test_lock() as the test's first statement, matching every sibling loopback test (same lock, same RAII scope held through the whole test), so it can no longer race siblings on loopback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fix could not compile The one-line fix from #207 called net_test_lock(), but the #216 in-memory migration (17e7d7b) had removed that helper together with most real-socket tests. The call sits behind cfg(target_os = "macos", feature = "macos-seatbelt"), so the Linux dev host never compiled it and macOS CI failed with E0425 (cannot find function net_test_lock). Restore the helper — the same poison-immune static-Mutex idiom #155 introduced — and take it in all three remaining real-socket tests (proxy_env…, fenced_child…, dropping_the_handle…), so the serialization domain is complete and the helper is used (not dead code under -D warnings) on every CI platform. Verified on an M4 mac: CI-parity clippy green; full workspace suite green under BRIDLE_REQUIRE_SEATBELT=1 with the fenced_child kernel proof genuinely running (no self-skip); tool-shell suite 5/5 repeat runs green; --no-default-features workspace tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
net_proxy::tests::fenced_child_reaches_allowed_via_proxy_denied_refused_direct_kernel_blockedwas the only remaining real-socket test in the
net_proxymodule without aserialization guard against sibling loopback tests; the PR #195 macOS CI flake
(
Empty reply from serveron the allow-leg) motivated #207.The first commit applied #207's one-line fix as written, but that issue predates
#216: the in-memory migration (17e7d7b) had already removed
net_test_lock()along with most real-socket tests, so the line failed macOS CI with E0425 — the
call is macos+seatbelt-gated and never compiled on the Linux dev host.
The second commit restores
net_test_lock()(the poison-immune static-Mutexidiom from #155) and takes it in all three remaining real-socket tests
(
proxy_env…,fenced_child…,dropping_the_handle…), so theserialization domain is complete and the helper is used — not dead code under
-D warnings— on every CI platform. The doc comment records the caveat thatthe lock is process-local: sufficient because
cargo testruns test binariessequentially; a per-test-process runner (nextest) would not be covered.
Test plan (verified on an M4 mac, macOS + seatbelt)
RUSTFLAGS="-D warnings" cargo clippy --workspace --exclude agent-bridle-py --all-targets --all-features -- -D warnings— green.BRIDLE_REQUIRE_SEATBELT=1 cargo test --workspace --exclude agent-bridle-py --all-features— green; thefenced_child…kernel proof genuinely ran (no self-skip; all three legs asserted).--no-default-featuresworkspace tests green.Fixes #207