Skip to content

Commit

Permalink
fix: change timeout for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Nov 17, 2022
1 parent 1f1096a commit 6ff9ff7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ void subscribe_Should_subscribeUser() throws Exception {
var stompSession = performConnect(FIRST_VALID_USER);
final Subscription subscription = performSubscribe(stompSession);


assertThat(this.socketUserRegistry.retrieveAllUsers(), hasSize(1));
WebSocketUserSession registeredUser = this.socketUserRegistry.retrieveAllUsers().get(0);
await()
.atMost(MESSAGE_TIMEOUT, SECONDS)
.atMost(15, SECONDS)
.until(registeredUser::getSubscriptionId, notNullValue());

assertThat(registeredUser, notNullValue());
Expand All @@ -110,11 +111,11 @@ void subscribe_Should_subscribeUser() throws Exception {
assertThat(registeredUser.getSubscriptionId(), notNullValue());
assertThat(subscription.getSubscriptionHeaders().get("destination"),
contains(SUBSCRIPTION_ENDPOINT));
performDisconnect(stompSession);
}

@Test
void disconnect_Should_removeUserFromRegistry() throws Exception {

var stompSession = performConnect(FIRST_VALID_USER);

assertThat(this.socketUserRegistry.retrieveAllUsers(), hasSize(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
public abstract class StompClientIntegrationTest extends AbstractJUnit4SpringContextTests {

protected static final String SUBSCRIPTION_ENDPOINT = "/user/events";
protected static final int MESSAGE_TIMEOUT = 2;
protected static final int MESSAGE_TIMEOUT = 5;
protected static final String FIRST_VALID_USER = "firstValidUser";
static final String SECOND_VALID_USER = "secondValidUser";
static final String THIRD_VALID_USER = "thirdValidUser";
Expand Down

0 comments on commit 6ff9ff7

Please sign in to comment.