Skip to content

Commit

Permalink
test: prevent closing Vite websocket client if already closed by serv…
Browse files Browse the repository at this point in the history
…er (#20425) (#20428)

Co-authored-by: Marco Collovati <[email protected]>
  • Loading branch information
vaadin-bot and mcollovati authored Nov 7, 2024
1 parent 99bef0b commit 65547dc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ public void onOpen(WebSocket webSocket) {
"Should not have been blocked too long after connection (elapsed time: "
+ elapsedTime + ")",
elapsedTime < 1000);
viteConnection.close();
closeLatch.await(2, TimeUnit.SECONDS);
if (!closeLatch.await(500, TimeUnit.MILLISECONDS)) {
viteConnection.close();
closeLatch.await(500, TimeUnit.MILLISECONDS);
}
}

@Test
Expand Down

0 comments on commit 65547dc

Please sign in to comment.