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
This commit is contained in:
Patrick Concannon 2020-06-05 16:40:16 +01:00
parent 13d30235e1
commit 97fc959e35

View File

@ -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++) {