Fix flaky test in MetricsHttpChannelListenerIntegrationTest
This commit is contained in:
parent
cd64390141
commit
0329184c94
|
@ -188,14 +188,18 @@ class MetricsHttpChannelListenerIntegrationTest {
|
||||||
: mock(Counter.class))
|
: mock(Counter.class))
|
||||||
.thenReturn(COUNTER);
|
.thenReturn(COUNTER);
|
||||||
|
|
||||||
|
final CompletableFuture<Void> connectionComplete = new CompletableFuture<>();
|
||||||
|
|
||||||
client.connect(new WebSocketListener() {
|
client.connect(new WebSocketListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onWebSocketConnect(final Session session) {
|
public void onWebSocketConnect(final Session session) {
|
||||||
session.close(1000, "OK");
|
session.close(1000, "OK");
|
||||||
|
connectionComplete.complete(null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
URI.create(String.format("ws://localhost:%d%s", EXTENSION.getLocalPort(), "/v1/websocket")), upgradeRequest)
|
URI.create(String.format("ws://localhost:%d%s", EXTENSION.getLocalPort(), "/v1/websocket")), upgradeRequest);
|
||||||
.get(1, TimeUnit.SECONDS);
|
|
||||||
|
connectionComplete.get(1, TimeUnit.SECONDS);
|
||||||
|
|
||||||
verify(METER_REGISTRY).counter(eq(MetricsHttpChannelListener.REQUEST_COUNTER_NAME), tagCaptor.capture());
|
verify(METER_REGISTRY).counter(eq(MetricsHttpChannelListener.REQUEST_COUNTER_NAME), tagCaptor.capture());
|
||||||
verify(COUNTER).increment();
|
verify(COUNTER).increment();
|
||||||
|
|
Loading…
Reference in New Issue