diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/futures/ClientFutureTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/futures/ClientFutureTest.java index c64d3ce96..3af2c81a9 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/futures/ClientFutureTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/futures/ClientFutureTest.java @@ -443,9 +443,11 @@ public void run() { runner.start(); assertTrue(syncing.await(5, TimeUnit.SECONDS)); + + Thread.yield(); runner.interrupt(); - assertTrue(done.await(5, TimeUnit.SECONDS)); + assertTrue(done.await(6, TimeUnit.SECONDS)); assertTrue(interrupted.get()); } @@ -480,9 +482,10 @@ public void run() { runner.start(); assertTrue(syncing.await(5, TimeUnit.SECONDS)); + Thread.yield(); runner.interrupt(); - assertTrue(done.await(5, TimeUnit.SECONDS)); + assertTrue(done.await(6, TimeUnit.SECONDS)); assertTrue(interrupted.get()); } diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ClientTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ClientTest.java index a14472d2f..5f0d0d558 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ClientTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ClientTest.java @@ -177,7 +177,7 @@ public void testCloseAllConnectionAndWait() throws Exception { firstPeer.expectClose().respond().afterDelay(10); secondPeer.expectClose().respond().afterDelay(15); - container.closeAsync().get(5, TimeUnit.SECONDS); + container.closeAsync().get(8, TimeUnit.SECONDS); firstPeer.waitForScriptToComplete(); secondPeer.waitForScriptToComplete(); diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ConnectionTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ConnectionTest.java index f60bee321..44a69b9d8 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ConnectionTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ConnectionTest.java @@ -761,7 +761,7 @@ private void doTestConnectionOpenTimeoutWhenNoRemoteOpenArrives(boolean timeout) LOG.info("Test started, peer listening on: {}", remoteURI); - final ConnectionOptions options = connectionOptions().openTimeout(75); + final ConnectionOptions options = connectionOptions().openTimeout(100); Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); @@ -778,7 +778,7 @@ private void doTestConnectionOpenTimeoutWhenNoRemoteOpenArrives(boolean timeout) LOG.info("connection open failed with error: ", error); } - peer.waitForScriptToComplete(5, TimeUnit.SECONDS); + peer.waitForScriptToComplete(6, TimeUnit.SECONDS); } } @@ -1609,7 +1609,7 @@ public void testOpenDurableReceiverFromConnection() throws Exception { connection.closeAsync().get(); - peer.waitForScriptToComplete(5, TimeUnit.SECONDS); + peer.waitForScriptToComplete(6, TimeUnit.SECONDS); } } diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java index 23ab5dc9b..a3d62ae46 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReceiverTest.java @@ -814,7 +814,7 @@ private void tryReadDynamicReceiverAddress(boolean attachResponse) throws Except LOG.info("Test started, peer listening on: {}", remoteURI); Client container = Client.create(); - ConnectionOptions options = new ConnectionOptions().openTimeout(100); + ConnectionOptions options = new ConnectionOptions().openTimeout(250); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); connection.openFuture().get(); @@ -935,7 +935,7 @@ private void tryReadReceiverSource(boolean attachResponse) throws Exception { LOG.info("Test started, peer listening on: {}", remoteURI); Client container = Client.create(); - ConnectionOptions options = new ConnectionOptions().openTimeout(100); + ConnectionOptions options = new ConnectionOptions().openTimeout(250); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); connection.openFuture().get(); @@ -1003,7 +1003,7 @@ private void tryReadReceiverTarget(boolean attachResponse) throws Exception { LOG.info("Test started, peer listening on: {}", remoteURI); Client container = Client.create(); - ConnectionOptions options = new ConnectionOptions().openTimeout(100); + ConnectionOptions options = new ConnectionOptions().openTimeout(250); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); connection.openFuture().get(); @@ -1074,7 +1074,7 @@ private void tryReadReceiverRemoteProperties(boolean attachResponse) throws Exce Session session = connection.openSession(); session.openFuture().get(); - ReceiverOptions options = new ReceiverOptions().openTimeout(100); + ReceiverOptions options = new ReceiverOptions().openTimeout(250); Receiver receiver = session.openReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS); @@ -1139,7 +1139,7 @@ private void tryReadReceiverRemoteOfferedCapabilities(boolean attachResponse) th LOG.info("Test started, peer listening on: {}", remoteURI); Client container = Client.create(); - ConnectionOptions options = new ConnectionOptions().openTimeout(100); + ConnectionOptions options = new ConnectionOptions().openTimeout(250); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); connection.openFuture().get(); @@ -1208,7 +1208,7 @@ private void tryReadReceiverRemoteDesiredCapabilities(boolean attachResponse) th LOG.info("Test started, peer listening on: {}", remoteURI); Client container = Client.create(); - ConnectionOptions options = new ConnectionOptions().openTimeout(100); + ConnectionOptions options = new ConnectionOptions().openTimeout(250); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort(), options); connection.openFuture().get(); diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java index 28cf77890..03d3fa24a 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java @@ -230,9 +230,9 @@ private void testReconnectStopsAfterSaslPermFailure(byte saslCode) throws Except connection.openFuture().get(); - firstPeer.waitForScriptToComplete(5, TimeUnit.SECONDS); - secondPeer.waitForScriptToComplete(5, TimeUnit.SECONDS); - thirdPeer.waitForScriptToComplete(5, TimeUnit.SECONDS); + firstPeer.waitForScriptToComplete(6, TimeUnit.SECONDS); + secondPeer.waitForScriptToComplete(6, TimeUnit.SECONDS); + thirdPeer.waitForScriptToComplete(6, TimeUnit.SECONDS); // Should connect, then fail and attempt to connect to second and third before stopping assertTrue(connected.await(5, TimeUnit.SECONDS)); diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/StreamReceiverTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/StreamReceiverTest.java index e3521b050..7824b220f 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/StreamReceiverTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/StreamReceiverTest.java @@ -3433,7 +3433,7 @@ private void tryReadReceiverRemoteProperties(boolean attachResponse) throws Exce Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort()); - StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(150, TimeUnit.MILLISECONDS); + StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(250, TimeUnit.MILLISECONDS); StreamReceiver receiver = connection.openStreamReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS); @@ -3501,7 +3501,7 @@ private void tryReadReceiverRemoteOfferedCapabilities(boolean attachResponse) th Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort()); - StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(150, TimeUnit.MILLISECONDS); + StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(250, TimeUnit.MILLISECONDS); StreamReceiver receiver = connection.openStreamReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS); @@ -3567,7 +3567,7 @@ private void tryReadReceiverRemoteDesiredCapabilities(boolean attachResponse) th Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort()); - StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(150, TimeUnit.MILLISECONDS); + StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(250, TimeUnit.MILLISECONDS); StreamReceiver receiver = connection.openStreamReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS); @@ -3633,7 +3633,7 @@ private void tryReadReceiverTarget(boolean attachResponse) throws Exception { Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort()); - StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(150, TimeUnit.MILLISECONDS); + StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(250, TimeUnit.MILLISECONDS); StreamReceiver receiver = connection.openStreamReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS); @@ -3697,7 +3697,7 @@ private void tryReadReceiverSource(boolean attachResponse) throws Exception { Client container = Client.create(); Connection connection = container.connect(remoteURI.getHost(), remoteURI.getPort()); - StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(150, TimeUnit.MILLISECONDS); + StreamReceiverOptions options = new StreamReceiverOptions().openTimeout(250, TimeUnit.MILLISECONDS); StreamReceiver receiver = connection.openStreamReceiver("test-receiver", options); peer.waitForScriptToComplete(5, TimeUnit.SECONDS);