From 97fc959e35636e0d06f4ec6f9abbb781f03dfdc3 Mon Sep 17 00:00:00 2001 From: Patrick Concannon Date: Fri, 5 Jun 2020 16:40:16 +0100 Subject: [PATCH] 8246132: AsynchronousSocketChannelNAPITest failing with a NotYetConnectedException Fix for intermitant failure with AsynchronousSocketChannelNAPITest that sometimes fails with a NotYetConnectedException while trying to read data after connecting Reviewed-by: alanb, dfuchs --- .../AsynchronousSocketChannelNAPITest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jdk/jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java b/test/jdk/jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java index 3886f1d3f45..efc69a610d0 100644 --- a/test/jdk/jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java +++ b/test/jdk/jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java @@ -101,9 +101,9 @@ public class AsynchronousSocketChannelNAPITest { ss.bind(new InetSocketAddress(hostAddr, 0)); try (var c = AsynchronousSocketChannel.open()) { - c.connect(ss.getLocalAddress()); + c.connect(ss.getLocalAddress()).get(); - try(var s = ss.accept().get()) { + try (var s = ss.accept().get()) { assertEquals((int) s.getOption(SO_INCOMING_NAPI_ID), 0); for (int i = 0; i < 10; i++) {