test: skip IPv6 tests when IPv6 is not available#4939
Merged
Conversation
- Add hasIPv6LocalhostSync() to synchronously check /etc/hosts for ::1 entry
- Conditionally skip tests using { skip: !ipv6Available } option
- IPv6-specific tests: 'Should throw when on dual-stack disabled (6)',
'Should automatically resolve IPs (dual stack disabled - 6)',
'Should we handle TTL (6)'
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4939 +/- ##
=======================================
Coverage 92.93% 92.94%
=======================================
Files 112 112
Lines 35709 35709
=======================================
+ Hits 33187 33190 +3
+ Misses 2522 2519 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
metcoder95
approved these changes
Apr 1, 2026
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.
This PR adds a check for IPv6 availability before running IPv6-specific DNS tests. When IPv6 is not available for localhost (i.e., ::1 is not in /etc/hosts), the IPv6-specific tests are skipped.
Changes
Why
The tests were failing on machines without IPv6 localhost configuration because they tried to connect to localhost expecting IPv6 resolution, which wasn't available. This caused timeouts and test failures.
Testing
All 25 tests pass, with 3 IPv6 tests properly skipped when IPv6 is unavailable. The remaining 22 tests pass normally.