Skip to content

Commit

Permalink
PROTON-2780 Extend some timeouts on tests that can fail in CI
Browse files Browse the repository at this point in the history
Some tests can use longer timeouts to account for slow CI VMs
  • Loading branch information
tabish121 committed Dec 6, 2023
1 parent 71dddbd commit 5c6721f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -1609,7 +1609,7 @@ public void testOpenDurableReceiverFromConnection() throws Exception {

connection.closeAsync().get();

peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
peer.waitForScriptToComplete(6, TimeUnit.SECONDS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5c6721f

Please sign in to comment.