Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257702

java/net/httpclient/ConnectTimeoutXXXX tests extending AbstractConnectTimeout.java may fail due to java.nio.channels.UnresolvedAddressException

XMLWordPrintable

      The test attempts to trigger a connection timeout by connecting to a non existent host (or proxy) - but can fail with UnresolvedAddressException.

      The test logic should be reexamined, or its checks should be relaxed.

      timeoutAsync(requestVersion=HTTP_2, scheme=https, method=GET, connectTimeout=null, requestTimeout=PT1S, proxy=java.net.ProxySelector$StaticProxySelector@499fc1c4)
      iteration 0
      Client: received in 152 millis
      java.net.ConnectException
      at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1038)
      at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:182)
      at java.net.http/jdk.internal.net.http.PlainTunnelingConnection.connectAsync(PlainTunnelingConnection.java:67)
      at java.net.http/jdk.internal.net.http.AsyncSSLTunnelConnection.connectAsync(AsyncSSLTunnelConnection.java:64)
      at java.net.http/jdk.internal.net.http.Http2Connection.createAsync(Http2Connection.java:378)
      at java.net.http/jdk.internal.net.http.Http2ClientImpl.getConnectionFor(Http2ClientImpl.java:128)
      at java.net.http/jdk.internal.net.http.ExchangeImpl.get(ExchangeImpl.java:93)
      at java.net.http/jdk.internal.net.http.Exchange.establishExchange(Exchange.java:342)
      at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl0(Exchange.java:474)
      at java.net.http/jdk.internal.net.http.Exchange.responseAsyncImpl(Exchange.java:379)
      at java.net.http/jdk.internal.net.http.Exchange.responseAsync(Exchange.java:371)
      at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(MultiExchange.java:407)
      at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsyncImpl$7(MultiExchange.java:448)
      at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
      at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
      at java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2330)
      at java.net.http/jdk.internal.net.http.MultiExchange.responseAsyncImpl(MultiExchange.java:438)
      at java.net.http/jdk.internal.net.http.MultiExchange.lambda$responseAsync0$2(MultiExchange.java:340)
      at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146)
      at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
      at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1769)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
      at java.base/java.lang.Thread.run(Thread.java:831)
      Caused by: java.nio.channels.UnresolvedAddressException
      at java.base/sun.nio.ch.Net.checkAddress(Net.java:149)
      at java.base/sun.nio.ch.Net.checkAddress(Net.java:157)
      at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(SocketChannelImpl.java:815)
      at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:837)
      at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:167)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
      at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:169)
      ... 22 more
      test ConnectTimeoutWithProxyAsync.timeoutWithProxyAsync(HTTP_2, "https", "GET", null, PT1S): failure
      java.lang.AssertionError: Expected HttpConnectTimeoutException, got:java.net.ConnectException
      at org.testng.Assert.fail(Assert.java:94)
      at AbstractConnectTimeout.assertExceptionTypeAndCause(AbstractConnectTimeout.java:237)
      at AbstractConnectTimeout.timeoutAsync(AbstractConnectTimeout.java:202)
      at AbstractConnectTimeout.timeoutWithProxyAsync(AbstractConnectTimeout.java:171)
      at ConnectTimeoutWithProxyAsync.timeoutWithProxyAsync(ConnectTimeoutWithProxyAsync.java:45)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
      at org.testng.TestRunner.privateRun(TestRunner.java:773)
      at org.testng.TestRunner.run(TestRunner.java:623)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
      at org.testng.SuiteRunner.run(SuiteRunner.java:259)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
      at org.testng.TestNG.run(TestNG.java:1018)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
      at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:831)

            dfuchs Daniel Fuchs
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: