8000 test(switch): gate bep_host socket tests under miri by gominimal-aw-bot[bot] · Pull Request #2165 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

test(switch): gate bep_host socket tests under miri - #2165

Merged
norrietaylor merged 2 commits into
mainfrom
inbox-patch/fix/switch-miri-bep-host-gating-61b80dd991bd99da
Oct 12, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
inbox-patch/fix/switch-miri-bep-host-gating-61b80dd991bd99da

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 11, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABWepU6w

The bep_host stack-peer integration tests bind real Unix sockets and create temp dirs. Under the nightly Miri lane (cargo miri test -p switch), Miri's default isolation refuses mkdir and cannot interpret the socket syscalls, so the lane fails in bep_host::tests instead of covering the primitives it was added to check.

Each of the twenty socket-backed tests is now gated #[cfg_attr(miri, ignore)] — the same pattern the subnet/MAC/vsock tests in lib.rs already use. loopback::tests::the_real_probe_covers_the_whole_range is gated the same way: it binds real TCP sockets, which Miri's isolation refuses, and it is the test the run aborted on before bep_host landed. The pure in-memory ARP/RST/UDP/delivery tests in bep_host keep running under Miri unchanged, so the lane still covers them.

Verification

  • cargo fmt --all --check --manifest-path target/Cargo.toml — pass, no drift
  • cargo clippy --workspace --all-targets --locked --manifest-path target/Cargo.toml -- -D warnings — pass, no warnings
  • cargo test --locked --manifest-path target/Cargo.toml -p switch — 61 passed, 0 failed, 0 ignored (all tests still run off the miri cfg)
  • RUSTFLAGS="--cfg miri" cargo test --locked --manifest-path target/Cargo.toml -p switch — 33 passed, 0 failed, 28 ignored: the 20 newly gated bep_host tests, the gated loopback real-probe test, and the 7 pre-existing lib.rs gates are skipped under the miri cfg, and the pure tests still run
  • just miri (cargo +nightly miri test -p switch) on a macOS arm64 host, at 88ece6b — test result: ok. 33 passed; 0 failed; 28 ignored. This is real Miri, so the 33 ungated tests (bep_host in-memory, loopback injected-binder, refusal, lib.rs) are interpreted clean under isolation.

The nightly Miri lane runs on Linux, so its next scheduled run remains the proof for that target.

Summary by CodeRabbit

  • Tests
    • Socket- and temporary-directory-based integration tests are now skipped under Miri, while in-memory device-pair tests remain enabled. The TCP-bind probe test is also skipped in that environment. Test behavior in other environments is unchanged.

The stack-peer integration tests in bep_host bind real Unix sockets
and create temp dirs. Miri's default isolation refuses mkdir and
cannot interpret the socket syscalls, so the nightly miri lane fails
in bep_host::tests.

Gate each of the twenty socket-backed tests with
#[cfg_attr(miri, ignore)], the pattern the subnet/MAC/vsock tests
in lib.rs already use. The pure in-memory ARP/RST/UDP/delivery
tests keep running under Miri unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 11, 2026 18:05
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 11, 2026
@coderabbitai
coderabbitai Bot commented Oct 11, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 6266872d-baa9-4463-b69c-de037aacdb37


📥 Commits

Reviewing files that changed from the base of the PR and between c4c6515 and 88ece6b.



📒 Files selected for processing (2)
  • crates/switch/src/bep_host.rs
  • crates/switch/src/loopback.rs


🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/switch/src/bep_host.rs


Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.




📝 Walkthrough
📝 Walkthrough

Walkthrough

Selected socket- and temporary-directory-based tests are now ignored under Miri. In-memory BepDevice::pair() tests remain enabled. Test behavior in other environments is unchanged.

Changes

Miri Test Exclusions

Layer / File(s) Summary
Miri-specific test annotations
crates/switch/src/bep_host.rs, crates/switch/src/loopback.rs
Selected switch-peer integration tests and the real TCP-bind probe test are marked to be ignored under Miri. A test-module comment distinguishes these tests from in-memory device tests, which remain enabled.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: norrietaylor



Merge Risk: ⚪ Minimal · up to 88ece

The change excludes socket- and temporary-directory-based tests under Miri while retaining in-memory tests. No actionable behavior risk is established; the reported test totals should be corrected, but the discrepancy alone does not block merging.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the test changes and the Miri-specific gating for socket-based bep_host tests. It is concise and follows the repository's Conventional Commit format.
Description check Passed The description explains the change, its purpose, affected tests, and verification results. It does not use the template's exact ## Summary, ## Testing, and ## Checklist headings, but it provide…

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR






🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the socket tests at night
Under Miri, they pause from their usual flight
The in-memory pairs still hop along
While loopback waits beyond the song
In other runs, tests carry on right

Comment @coderabbitai help to get the list of available commands.

@norrietaylor norrietaylor changed the title fix: gate bep_host socket tests under miri test(switch): gate bep_host socket tests under miri Oct 11, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 11, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 88ece6bddb20.

Nothing to do.

Clobber: none: git log on the range shows only the two gating commits, no recent fix reverted.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 11, 2026
the_real_probe_covers_the_whole_range binds real TCP sockets, which
Miri's isolation refuses, so the run aborted there once the bep_host
socket tests ahead of it were ignored. Gate it like them, and state the
gating rule once at the top of the bep_host test module.
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 11, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on ARCH PASS at 88ece6b.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 11, 2026
@norrietaylor
norrietaylor removed this pull request from the merge queue due to a manual request Oct 11, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit 1e32c2b Oct 12, 2026
36 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/fix/switch-miri-bep-host-gating-61b80dd991bd99da branch October 12, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0