Repository navigation
acpmux: the sandbox proxy's unreachable-target test holds a bound, non-listening port (flake) - #27447
Conversation
…n-listening port `linux_sandbox::proxy::tests::allowed_but_unreachable_returns_502` bound a listener, dropped it and expected a connect to its port to be refused. A process another test is spawning holds a copy of the listener from its fork until its exec (or, for a forked test child that never execs, for its life), and the socket keeps listening until that copy closes, so the proxy's connect succeeded and the reply was not 502. The test now holds a socket that is bound and never listens: connects to it are refused whatever copies exist, and no other test can take its port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1288bbb2b5d2f5c6b66a
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: green on the base 5f448b1; do not merge until green; see lane-rules |
|
Owned by an agent session · session |
|
Found 8 test failures on Blacksmith runners: Failures
|
|
Bead |
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (gpt-6-astra, high, fast; independent Codex reviewer): SHIP at b0fd0da
No correctness blockers:
- Linux refuses connections to a bound TCP socket that is not listening, with RST/
ECONNREFUSED, and forked copies keep it not listening. TcpSocket::new_v4()leaves address reuse off, so no other test can bind that endpoint, and ephemeral binds cannot take it.- A refused connect to a permitted address still takes the proxy's
502path. - The
502assertion is unchanged, and no clippy issue is introduced.
Reds at this head, all base reds that fail the same way on feat-cmux-next, none this PR's:
cmux-tui SDKs / protocol contractandcmux-tui spec inventory / inventory: test_irtest_live_raw_v12_layout_and_history_contracts_are_exact, command new-pane-right.cmux-next checks: No new SwiftUI.
|
Shipped in:
|
|
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40895243022 at 25e72b6 failed: cmux-next checks (god files, concurrency, crash safety, l10n). |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Flake fix for a red seen in full
cargo test -p acpmux --libruns:linux_sandbox::proxy::tests::allowed_but_unreachable_returns_502failed atproxy.rs:546(reply not502) once in 20 runs. The tree was base plus a test-only change elsewhere. Never blocked.The cause
The test binds a listener, drops it, and expects the proxy's connect to that port to be refused. A process another test is spawning holds a copy of the listener from its fork until its exec. A forked test child that never execs holds it for its whole life. The socket keeps listening until that copy closes, so the connect succeeded and the proxy did not answer
502. This is the same listener-copy problem as #27423 and #27434.Reproduced deterministically: with a copy of the listener held across the drop, as a spawned child does, the old test fails 5 of 5 (run).
The fix
Test only. The test now keeps a socket that is bound and never listens. Connects to it are refused whatever copies exist, and no other test can take its port while it is held. The assertion is unchanged: the proxy answers
502for an allowed but unreachable target.Evidence (Linux,
cmux-ci test, 32 vCPU)linux_sandbox::proxytests, 8 threads spawning and parking 5 ms between fork and execcargo test -p acpmux --libcargo clippy -p acpmux --all-targets -- -D warnings,cargo fmt --checkOther reds in the 20x run come from causes already fixed on feat-cmux-next since this branch was cut: the protocol IR (#27438), the consent flock (#27435), ETXTBSY (#27441) and the WireGuard rebind (#27434).
Risk: low, test-only, one test.
Agent session: agent session
🤖 Generated with Claude Code