Skip to content

Skip dual-stack bind tests when the host lacks IPv6#1878

Merged
kixelated merged 1 commit into
mainfrom
claude/ipv6-dual-stack-resilience-l2qv9e
Jun 22, 2026
Merged

Skip dual-stack bind tests when the host lacks IPv6#1878
kixelated merged 1 commit into
mainfrom
claude/ipv6-dual-stack-resilience-l2qv9e

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

The tcp_ipv6_is_dual_stack and udp_ipv6_is_dual_stack tests in rs/moq-native/src/bind.rs bind [::]:0 to verify the socket comes back dual-stack. On hosts without an IPv6 stack (some CI sandboxes and containers) that bind fails outright, before the dual-stack flag can even be checked, so the tests fail for an environmental reason rather than an actual bug.

This makes those two tests resilient: they now treat the address-family family of errors as a "no IPv6 here" signal and skip (printing a note) instead of failing. The dual-stack assertion only has meaning once a socket exists, so there's nothing to verify when IPv6 is absent.

Detected error conditions:

  • EAFNOSUPPORT (97), EADDRNOTAVAIL (99), EPROTONOSUPPORT (93) on Unix
  • WSAEAFNOSUPPORT (10047), WSAEADDRNOTAVAIL (10049), WSAEPROTONOSUPPORT (10043) on Windows
  • ErrorKind::AddrNotAvailable / ErrorKind::Unsupported

The production udp/tcp bind helpers are unchanged: a relay that genuinely can't bind its configured address should still fail loudly. Only the tests relax.

Test plan

  • cargo test -p moq-native --lib bind passes in this IPv6-less sandbox (the two IPv6 tests skip, udp_ipv4_still_binds passes).
  • On a host with IPv6, the assertions run as before.

🤖 Generated with Claude Code

(Written by Claude)


Generated by Claude Code

The tcp/udp_ipv6_is_dual_stack tests bind [::]:0, which fails on hosts
without an IPv6 stack (some CI sandboxes and containers) before the
dual-stack flag can be checked. Treat the address-family errors
(EAFNOSUPPORT, EADDRNOTAVAIL, EPROTONOSUPPORT and the WSA* equivalents)
as an environment limitation and skip rather than fail, since the
assertion only has meaning once a socket exists.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ntj3vomLhnYc39EUGdASGp
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c606dea-d120-4261-876e-e11d93e16334

📥 Commits

Reviewing files that changed from the base of the PR and between ead91b0 and 793cf6a.

📒 Files selected for processing (1)
  • rs/moq-native/src/bind.rs

Walkthrough

The test module in rs/moq-native/src/bind.rs gains a skip_if_no_ipv6 helper function that inspects a std::io::Error by checking its ErrorKind and a hardcoded list of raw OS error codes to determine whether the error indicates the host has no IPv6 support. Both udp_ipv6_is_dual_stack and tcp_ipv6_is_dual_stack are changed from unconditional .unwrap() calls to match expressions: on an IPv6-absence error they return early (skipping the test), and on any other error they panic with a targeted message.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: making dual-stack bind tests skip when IPv6 is unavailable, which aligns with the core objective of the PR.
Description check ✅ Passed The description is well-related to the changeset, providing clear context about why the tests needed modification, what errors are being handled, and verification that the fix works as intended.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/ipv6-dual-stack-resilience-l2qv9e

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@kixelated kixelated merged commit 994323c into main Jun 22, 2026
1 check passed
@kixelated kixelated deleted the claude/ipv6-dual-stack-resilience-l2qv9e branch June 22, 2026 21:07
This was referenced Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants