Skip dual-stack bind tests when the host lacks IPv6#1878
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe test module in 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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. Comment |
Summary
The
tcp_ipv6_is_dual_stackandudp_ipv6_is_dual_stacktests inrs/moq-native/src/bind.rsbind[::]:0to 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 UnixWSAEAFNOSUPPORT(10047),WSAEADDRNOTAVAIL(10049),WSAEPROTONOSUPPORT(10043) on WindowsErrorKind::AddrNotAvailable/ErrorKind::UnsupportedThe production
udp/tcpbind 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 bindpasses in this IPv6-less sandbox (the two IPv6 tests skip,udp_ipv4_still_bindspasses).🤖 Generated with Claude Code
(Written by Claude)
Generated by Claude Code