From b1a11206e318bb3313ec9c20d54306ac3c44f9d6 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Mon, 16 Dec 2024 13:08:31 +0100 Subject: [PATCH] test: improve async reliability of AbstractHttpClientNewWebSocketBuilderTest Signed-off-by: Marc Nuri --- .../client/http/AbstractHttpClientNewWebSocketBuilderTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpClientNewWebSocketBuilderTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpClientNewWebSocketBuilderTest.java index fd24e7e66c7..087c77a9f1c 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpClientNewWebSocketBuilderTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpClientNewWebSocketBuilderTest.java @@ -98,7 +98,7 @@ void buildAsyncReceivesMultipleMessages() throws Exception { .always(); final CountDownLatch latch = new CountDownLatch(2); final Set messages = ConcurrentHashMap.newKeySet(); - final WebSocket ws = httpClient.newWebSocketBuilder() + httpClient.newWebSocketBuilder() .uri(URI.create(server.url("/websocket-multiple-message"))) .buildAsync(new WebSocket.Listener() { @Override @@ -157,6 +157,7 @@ void buildAsyncIncludesRequiredHeaders() throws Exception { server.expect().withPath("/websocket-headers-test") .andUpgradeToWebSocket() .open() + .waitFor(50L).andEmit("OK") .done() .always(); httpClient.newWebSocketBuilder()