diff --git a/kaldb/pom.xml b/kaldb/pom.xml index fe9e6469fc..6b34b9e383 100644 --- a/kaldb/pom.xml +++ b/kaldb/pom.xml @@ -31,6 +31,7 @@ 2.20.0 2.20.116 2.16 + 5.10.0 @@ -377,19 +378,19 @@ org.junit.jupiter junit-jupiter - 5.9.1 + ${junit.jupiter.version} test org.junit.jupiter junit-jupiter-api - 5.9.1 + ${junit.jupiter.version} test org.junit.platform junit-platform-launcher - 1.9.3 + 1.10.0 org.awaitility diff --git a/kaldb/src/test/java/com/slack/kaldb/chunkManager/IndexingChunkManagerTest.java b/kaldb/src/test/java/com/slack/kaldb/chunkManager/IndexingChunkManagerTest.java index 91679789d3..09bac9776f 100644 --- a/kaldb/src/test/java/com/slack/kaldb/chunkManager/IndexingChunkManagerTest.java +++ b/kaldb/src/test/java/com/slack/kaldb/chunkManager/IndexingChunkManagerTest.java @@ -1422,11 +1422,20 @@ private void insertMessages( actualMessagesGauge++; actualBytesGauge += msgSize; if (actualMessagesGauge < msgsPerChunk) { - assertThat(getValue(LIVE_MESSAGES_INDEXED, metricsRegistry)).isEqualTo(actualMessagesGauge); - assertThat(getValue(LIVE_BYTES_INDEXED, metricsRegistry)).isEqualTo(actualBytesGauge); + final int finalActualMessagesGauge = actualMessagesGauge; + await() + .until( + () -> getValue(LIVE_MESSAGES_INDEXED, metricsRegistry), + (value) -> value == finalActualMessagesGauge); + final int finalActualBytesGauge = actualBytesGauge; + await() + .until( + () -> getValue(LIVE_BYTES_INDEXED, metricsRegistry), + (value) -> value == finalActualBytesGauge); } else { // Gauge is reset on roll over - assertThat(getValue(LIVE_MESSAGES_INDEXED, metricsRegistry)).isEqualTo(0); - assertThat(getValue(LIVE_BYTES_INDEXED, metricsRegistry)).isEqualTo(0); + await() + .until(() -> getValue(LIVE_MESSAGES_INDEXED, metricsRegistry), (value) -> value == 0); + await().until(() -> getValue(LIVE_BYTES_INDEXED, metricsRegistry), (value) -> value == 0); } } }