Skip to content

Commit d30a69a

Browse files
committed
Fix flaky DefaultAcknowledgementSetManagerTests.testExpirations
Move the monitor size assertion into the await().untilAsserted() block. The assertion was placed after Thread.sleep() but before await(), assuming the cleanup thread had already run. Under CI load, the cleanup may not have completed in time, causing intermittent failures. Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
1 parent cf682e7 commit d30a69a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data-prepper-core/src/test/java/org/opensearch/dataprepper/core/acknowledgements/DefaultAcknowledgementSetManagerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ void testBasic() {
110110
void testExpirations() throws InterruptedException {
111111
eventHandle2.release(true);
112112
Thread.sleep(TEST_TIMEOUT.multipliedBy(2).toMillis());
113-
assertThat(acknowledgementSetManager.getAcknowledgementSetMonitor().getSize(), equalTo(0));
114113
await().atMost(TEST_TIMEOUT.multipliedBy(3))
115114
.untilAsserted(() -> {
115+
assertThat(acknowledgementSetManager.getAcknowledgementSetMonitor().getSize(), equalTo(0));
116116
assertThat(result, equalTo(null));
117117
});
118118
}

0 commit comments

Comments
 (0)