Fix flaky test in MetricsHttpChannelListenerIntegrationTest

This commit is contained in:
Chris Eager authored and Jon Chambers committed 2024-02-18 20:08:29 -05:00
1 parent cd64390141
commit 0329184c94
1 file changed
+6 -2
@@ -188,14 +188,18 @@ class MetricsHttpChannelListenerIntegrationTest {
: mock(Counter.class))
.thenReturn(COUNTER);
final CompletableFuture<Void> connectionComplete = new CompletableFuture<>();
client.connect(new WebSocketListener() {
@Override
public void onWebSocketConnect(final Session session) {
session.close(1000, "OK");
connectionComplete.complete(null);
}
},
URI.create(String.format("ws://localhost:%d%s", EXTENSION.getLocalPort(), "/v1/websocket")), upgradeRequest)
.get(1, TimeUnit.SECONDS);
URI.create(String.format("ws://localhost:%d%s", EXTENSION.getLocalPort(), "/v1/websocket")), upgradeRequest);
connectionComplete.get(1, TimeUnit.SECONDS);
verify(METER_REGISTRY).counter(eq(MetricsHttpChannelListener.REQUEST_COUNTER_NAME), tagCaptor.capture());
verify(COUNTER).increment();