GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — Harden DnsNameResolverTest against transient null localAddress from TestDnsServer by normanmaurer · Pull Request #17514 · netty/netty Conversation
Member
MotivationWe've seen sporadic failures like this on Windows CI:
ModificationTreat a Result
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: TestDnsServer.localAddress() can return null even after start() returns without throwing, since the MINA NioDatagramAcceptor completes the bind on a background thread. This apparently races on Windows CI, causing DnsServerAddresses.singleton() to NPE with "address" in testTruncatedWithTcpFallbackBecauseOfMtu and similar TCP-fallback tests. Modifications: - Retry like any other bind failure when this happens. Result: Less flaky tests
|
There was an error while loading. Please reload this page.
🚨 TestLens detected 2 failed tests 🚨Here is what you can do:
Failed Jobs without Test Failures❌ Build PR / linux-x86_64-java24 build Test SummaryBuild PR / linux-x86_64-java11 build > Netty/Codec/HTTP2
Build PR / macos-x86_64-java11-boringssl build > Netty/Transport/Native/KQueue
🏷️ Commit: c759736 Test FailuresHttp2ConnectionRoundtripTest > listenerIsNotifiedOfGoawayBeforeStreamsAreRemovedFromTheConnection() (Netty/Codec/HTTP2 in Build PR / linux-x86_64-java11 build)
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendCompositeMixedByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java11-boringssl build)Rerun ControlsSelect tests to mute in this pull request:
Reuse successful test results:
Click the checkbox to trigger a rerun:
Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Auto-port PR for 5.0: #17521 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Auto-port PR for 4.1: #17522 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lAddress from TestDnsServer (#17522) Auto-port of #17514 to 4.1 Cherry-picked commit: f435d97 --- ## Motivation We've seen sporadic failures like this on Windows CI: ``` DnsNameResolverTest > testTruncatedWithTcpFallbackBecauseOfMtu(DnsNameResolverChannelStrategy) > [1] ChannelPerResolver java.lang.NullPointerException: address at io.netty.util.internal.ObjectUtil.checkNotNull(ObjectUtil.java:39) at io.netty.resolver.dns.DnsServerAddresses.singleton(DnsServerAddresses.java:152) at io.netty.resolver.dns.SingletonDnsServerAddressStreamProvider.<init>(SingletonDnsServerAddressStreamProvider.java:29) at io.netty.resolver.dns.DnsNameResolverTest.testTruncated0(DnsNameResolverTest.java:3480) ``` `TestDnsServer.localAddress()` reads the local address off the MINA `NioDatagramAcceptor` used by our test DNS server. The actual bind happens asynchronously on a background `Acceptor` thread; the calling thread only blocks on a future until that thread signals completion. `startDnsServerAndCreateServerSocket()` already retries when `start()` throws `IOException` (e.g. port already in use), but it assumed a non-throwing `start()` always leaves a valid local address behind. Apparently that isn't always true - most likely a timing/visibility race in this old, unmaintained MINA-based test dependency - and it seems to surface more readily on Windows, leaving `localAddress()` null and blowing up `DnsServerAddresses.singleton(...)`. ## Modification Treat a `null` `localAddress()` right after a "successful" `start()` the same way as a bind failure in `startDnsServerAndCreateServerSocket()`: stop the server, close the socket, and retry (bounded by the existing retry count), instead of returning a server that can't actually be used. ## Result `testTruncatedWithTcpFallbackBecauseOfMtu` and the other tests going through `startDnsServerAndCreateServerSocket()` no longer NPE when the underlying test DNS server's UDP acceptor doesn't report a local address on the first attempt. Co-authored-by: Norman Maurer <[email protected]>
…lAddress from TestDnsServer (#17521) Auto-port of #17514 to 5.0 Cherry-picked commit: f435d97 --- ## Motivation We've seen sporadic failures like this on Windows CI: ``` DnsNameResolverTest > testTruncatedWithTcpFallbackBecauseOfMtu(DnsNameResolverChannelStrategy) > [1] ChannelPerResolver java.lang.NullPointerException: address at io.netty.util.internal.ObjectUtil.checkNotNull(ObjectUtil.java:39) at io.netty.resolver.dns.DnsServerAddresses.singleton(DnsServerAddresses.java:152) at io.netty.resolver.dns.SingletonDnsServerAddressStreamProvider.<init>(SingletonDnsServerAddressStreamProvider.java:29) at io.netty.resolver.dns.DnsNameResolverTest.testTruncated0(DnsNameResolverTest.java:3480) ``` `TestDnsServer.localAddress()` reads the local address off the MINA `NioDatagramAcceptor` used by our test DNS server. The actual bind happens asynchronously on a background `Acceptor` thread; the calling thread only blocks on a future until that thread signals completion. `startDnsServerAndCreateServerSocket()` already retries when `start()` throws `IOException` (e.g. port already in use), but it assumed a non-throwing `start()` always leaves a valid local address behind. Apparently that isn't always true - most likely a timing/visibility race in this old, unmaintained MINA-based test dependency - and it seems to surface more readily on Windows, leaving `localAddress()` null and blowing up `DnsServerAddresses.singleton(...)`. ## Modification Treat a `null` `localAddress()` right after a "successful" `start()` the same way as a bind failure in `startDnsServerAndCreateServerSocket()`: stop the server, close the socket, and retry (bounded by the existing retry count), instead of returning a server that can't actually be used. ## Result `testTruncatedWithTcpFallbackBecauseOfMtu` and the other tests going through `startDnsServerAndCreateServerSocket()` no longer NPE when the underlying test DNS server's UDP acceptor doesn't report a local address on the first attempt. Co-authored-by: Norman Maurer <[email protected]>
…lAddress from TestDnsServer (netty#17522) Auto-port of netty#17514 to 4.1 Cherry-picked commit: f435d97 --- ## Motivation We've seen sporadic failures like this on Windows CI: ``` DnsNameResolverTest > testTruncatedWithTcpFallbackBecauseOfMtu(DnsNameResolverChannelStrategy) > [1] ChannelPerResolver java.lang.NullPointerException: address at io.netty.util.internal.ObjectUtil.checkNotNull(ObjectUtil.java:39) at io.netty.resolver.dns.DnsServerAddresses.singleton(DnsServerAddresses.java:152) at io.netty.resolver.dns.SingletonDnsServerAddressStreamProvider.<init>(SingletonDnsServerAddressStreamProvider.java:29) at io.netty.resolver.dns.DnsNameResolverTest.testTruncated0(DnsNameResolverTest.java:3480) ``` `TestDnsServer.localAddress()` reads the local address off the MINA `NioDatagramAcceptor` used by our test DNS server. The actual bind happens asynchronously on a background `Acceptor` thread; the calling thread only blocks on a future until that thread signals completion. `startDnsServerAndCreateServerSocket()` already retries when `start()` throws `IOException` (e.g. port already in use), but it assumed a non-throwing `start()` always leaves a valid local address behind. Apparently that isn't always true - most likely a timing/visibility race in this old, unmaintained MINA-based test dependency - and it seems to surface more readily on Windows, leaving `localAddress()` null and blowing up `DnsServerAddresses.singleton(...)`. ## Modification Treat a `null` `localAddress()` right after a "successful" `start()` the same way as a bind failure in `startDnsServerAndCreateServerSocket()`: stop the server, close the socket, and retry (bounded by the existing retry count), instead of returning a server that can't actually be used. ## Result `testTruncatedWithTcpFallbackBecauseOfMtu` and the other tests going through `startDnsServerAndCreateServerSocket()` no longer NPE when the underlying test DNS server's UDP acceptor doesn't report a local address on the first attempt. Co-authored-by: Norman Maurer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.