Skip to content

Port: DnsAddressResolverGroupTest: Use a mock DNS server instead of resolving netty.io over the network (#17566) - #17577

Merged
normanmaurer merged 1 commit into
4.1from
dns_41
Sep 22, 2026
Merged

normanmaurer merged 1 commit into
4.1from
dns_41

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

testSharedDNSCacheAcrossEventLoops resolved the real netty.io hostname
over the network to verify that DnsAddressResolverGroup shares its DNS
cache across EventLoops. netty.io is fronted by Cloudflare, and live
queries can return different edge IPs on different lookups, which made
the assertSame check flaky regardless of whether the cache was actually
shared.

Modification:

Use a TestDnsServer (as already done in DnsNameResolverTest) backed by
a RecordStore that always returns a single, fixed A record for
netty.io, and point the resolver's nameServerProvider at it. This makes
both resolutions deterministic so the assertion only depends on the
cache-sharing behavior under test.

Result:

testSharedDNSCacheAcrossEventLoops no longer depends on the live DNS
answer for netty.io and is no longer flaky due to external network
behavior.

…ng netty.io over the network (#17566)

Motivation:

testSharedDNSCacheAcrossEventLoops resolved the real netty.io hostname
over the network to verify that DnsAddressResolverGroup shares its DNS
cache across EventLoops. netty.io is fronted by Cloudflare, and live
queries can return different edge IPs on different lookups, which made
the assertSame check flaky regardless of whether the cache was actually
shared.

Modification:

Use a TestDnsServer (as already done in DnsNameResolverTest) backed by
a RecordStore that always returns a single, fixed A record for
netty.io, and point the resolver's nameServerProvider at it. This makes
both resolutions deterministic so the assertion only depends on the
cache-sharing behavior under test.

Result:

testSharedDNSCacheAcrossEventLoops no longer depends on the live DNS
answer for netty.io and is no longer flaky due to external network
behavior.
@normanmaurer normanmaurer changed the title DnsAddressResolverGroupTest: Use a mock DNS server instead of resolving netty.io over the network (#17566) Port: DnsAddressResolverGroupTest: Use a mock DNS server instead of resolving netty.io over the network (#17566) Sep 21, 2026
@testlens-app

testlens-app Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 52b5fd8
▶️ Tests: 390460 executed
⚪️ Checks: 18/18 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer
normanmaurer merged commit a8a6f71 into 4.1 Sep 22, 2026
19 checks passed
@normanmaurer
normanmaurer deleted the dns_41 branch September 22, 2026 06:36
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
…esolving netty.io over the network (netty#17566) (netty#17577)

Motivation:

testSharedDNSCacheAcrossEventLoops resolved the real netty.io hostname
over the network to verify that DnsAddressResolverGroup shares its DNS
cache across EventLoops. netty.io is fronted by Cloudflare, and live
queries can return different edge IPs on different lookups, which made
the assertSame check flaky regardless of whether the cache was actually
shared.

Modification:

Use a TestDnsServer (as already done in DnsNameResolverTest) backed by
a RecordStore that always returns a single, fixed A record for
netty.io, and point the resolver's nameServerProvider at it. This makes
both resolutions deterministic so the assertion only depends on the
cache-sharing behavior under test.

Result:

testSharedDNSCacheAcrossEventLoops no longer depends on the live DNS
answer for netty.io and is no longer flaky due to external network
behavior.
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.

1 participant