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 — Auto-port 5.0: Harden DnsNameResolverTest against transient null localAddress from TestDnsServer by netty-project-bot · Pull Request #17521 · netty/netty Conversation
Contributor
Auto-port of #17514 to 5.0 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 reactions…estDnsServer (#17514) ## 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. (cherry picked from commit f435d97)
|
There was an error while loading. Please reload this page.
🚨 TestLens detected 1 failed test 🚨Here is what you can do:
Test SummaryBuild PR / macos-x86_64-java25-boringssl build > Netty/Transport/Native/KQueue
🏷️ Commit: 5a3d9c3 Test FailuresKQueueDatagramUnicastIPv6MappedTest > testSimpleSendHeapByteBuf(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-x86_64-java25-boringssl build)Rerun ControlsNote Checks are currently running using the configuration below. Select tests to mute in this pull request: 🔲 KQueueDatagramUnicastIPv6MappedTest > testSimpleSendHeapByteBuf(TestInfo) Reuse successful test results: 🔲 ♻️ Only rerun the tests that failed or were muted before Click the checkbox to trigger a rerun: 🔲 Rerun jobs 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.
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.