Skip to content

Commit

Permalink
Fix GitHub actions failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
corcoja committed Apr 5, 2022
1 parent 9201f61 commit 27e5452
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ public void newMessageReceived(SubOnlyTunnel tunnel, String subject, String mess
};
assertDoesNotThrow(() -> pubSubTransceiver.subscribe(subHandler));

// Test subscribed and active subscription after a few seconds
TimeUnit.SECONDS.sleep(2);
assertTrue(pubSubTransceiver.isSubscribed());
assertTrue(pubSubTransceiver.isSubscriptionActive());
// Wait until the subscription is set and active
Awaitility.await().atMost(Duration.ofSeconds(4)).with().pollInterval(Duration.ofMillis(500))
.until(() -> pubSubTransceiver.isSubscribed() && pubSubTransceiver.isSubscriptionActive());

// Stop the server and wait a few seconds
natsServer.stop();
Expand Down Expand Up @@ -270,10 +269,9 @@ public void newMessageReceived(SubOnlyTunnel tunnel, String subject, String mess
};
assertDoesNotThrow(() -> pubSubTransceiver.subscribe(subHandler));

// Test subscribed and active subscription after a few seconds
TimeUnit.SECONDS.sleep(2);
assertTrue(pubSubTransceiver.isSubscribed());
assertTrue(pubSubTransceiver.isSubscriptionActive());
// Wait until the subscription is set and active
Awaitility.await().atMost(Duration.ofSeconds(4)).with().pollInterval(Duration.ofMillis(500))
.until(() -> pubSubTransceiver.isSubscribed() && pubSubTransceiver.isSubscriptionActive());

// Stop the server and wait a few seconds
natsServer.stop();
Expand Down

0 comments on commit 27e5452

Please sign in to comment.