connectd/tests: fix test_announce_and_connect_via_dns on macOS#9143
Merged
Conversation
89d3d46 to
b7b271c
Compare
ddustin
requested changes
Jun 18, 2026
b7b271c to
e47a833
Compare
e47a833 to
4108150
Compare
Collaborator
|
Rebasing for CI |
4108150 to
3bef57a
Compare
localhost.localdomain is not present in /etc/hosts on macOS by default, so the test's DNS-resolve step fails immediately. Any hostname that does resolve on macOS (e.g. test.localhost via mDNSResponder) causes mDNSResponder to open temporary sockets which dev_report_fds() flags as unowned (BROKEN) at teardown. Skip the test explicitly on macOS with @unittest.skipIf so the reason is visible and trackable. A follow-up can fix dev_report_fds to tolerate resolver sockets and re-enable the test on macOS. Changelog-None
3bef57a to
40f2ce6
Compare
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.
Summary
test_announce_and_connect_via_dnswith a clear message whenlocalhost.localdomainis not resolvable (macOS omits it from/etc/hostsby default)AI_ADDRCONFIGintry_connect_one_addr()with#ifndef __APPLE__: on macOS/BSD,AI_ADDRCONFIGopens temporary probe sockets that are not tracked by theioframework, causingdev_report_fds()to report them as unowned (**BROKEN**); Linux keeps the optimization unchangedCloses #9012
Test plan
uv run pytest tests/test_gossip.py::test_announce_and_connect_via_dns -vpasses on Linuxlocalhost.localdomainin/etc/hosts: test is skipped with a descriptive messagelocalhost.localdomainin/etc/hosts: no**BROKEN**fd messages from connectd at teardown🤖 Generated with Claude Code