From 3ff2ff54bbac1c3600c9f8b8e8ab4ae57ec082fa Mon Sep 17 00:00:00 2001 From: jrhee17 Date: Tue, 16 Jul 2024 15:23:34 +0900 Subject: [PATCH] fix flaky tests --- .../java/com/linecorp/armeria/server/ServerMetricsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/com/linecorp/armeria/server/ServerMetricsTest.java b/core/src/test/java/com/linecorp/armeria/server/ServerMetricsTest.java index 11b21bcac4a..43106ff8cf3 100644 --- a/core/src/test/java/com/linecorp/armeria/server/ServerMetricsTest.java +++ b/core/src/test/java/com/linecorp/armeria/server/ServerMetricsTest.java @@ -206,7 +206,7 @@ void checkWhenOk(SessionProtocol sessionProtocol, long expectedPendingHttp1Reque assertThat(result.status()).isSameAs(HttpStatus.OK); assertThat(serverMetrics.pendingRequests()).isZero(); - assertThat(serverMetrics.activeRequests()).isZero(); + await().untilAsserted(() -> assertThat(serverMetrics.activeRequests()).isZero()); await().until(() -> serverMetrics.activeConnections() == 0); } } @@ -273,7 +273,7 @@ void checkWhenRequestTimeout(SessionProtocol sessionProtocol, long expectedPendi assertThat(result.status()).isSameAs(HttpStatus.SERVICE_UNAVAILABLE); assertThat(serverMetrics.pendingRequests()).isZero(); - assertThat(serverMetrics.activeRequests()).isZero(); + await().untilAsserted(() -> assertThat(serverMetrics.activeRequests()).isZero()); await().until(() -> serverMetrics.activeConnections() == 0); } }