Describe the bug
DefaultAcknowledgementSetManagerTests.testExpirations() intermittently fails in CI with:
java.lang.AssertionError:
Expected: <0>
but: was <1>
at org.opensearch.dataprepper.core.acknowledgements.DefaultAcknowledgementSetManagerTests.testExpirations(
DefaultAcknowledgementSetManagerTests.java:113)
To Reproduce
Run ./gradlew :data-prepper-core:test --tests "org.opensearch.dataprepper.core.acknowledgements.DefaultAcknowledgementSetManagerTests.testExpirations" --rerun repeatedly. The failure is intermittent and more likely under CPU load.
Expected behavior
The test should pass consistently regardless of system load.
Environment (please complete the following information):
Additional context
The test sleeps for TEST_TIMEOUT * 2 (800ms) and then immediately asserts that the acknowledgement set monitor size is 0. This assumes the monitor's cleanup thread has already removed the expired set during the sleep window. Under CI load, the cleanup may not have completed in time, leaving the size at 1.
The subsequent await().atMost(TEST_TIMEOUT.multipliedBy(3)) only checks the result field, not the monitor size, so the stale monitor size is never retried.
A fix would be to move the getSize() == 0 assertion into an await().untilAsserted() block, similar to the pattern used in testBasic().
Describe the bug
DefaultAcknowledgementSetManagerTests.testExpirations()intermittently fails in CI with:To Reproduce
Run
./gradlew :data-prepper-core:test --tests "org.opensearch.dataprepper.core.acknowledgements.DefaultAcknowledgementSetManagerTests.testExpirations" --rerunrepeatedly. The failure is intermittent and more likely under CPU load.Expected behavior
The test should pass consistently regardless of system load.
Environment (please complete the following information):
Gradle Build / build (11)on PR Support pluggable shuffle storage backend for iceberg-source #6712Additional context
The test sleeps for
TEST_TIMEOUT * 2(800ms) and then immediately asserts that the acknowledgement set monitor size is 0. This assumes the monitor's cleanup thread has already removed the expired set during the sleep window. Under CI load, the cleanup may not have completed in time, leaving the size at 1.The subsequent
await().atMost(TEST_TIMEOUT.multipliedBy(3))only checks theresultfield, not the monitor size, so the stale monitor size is never retried.A fix would be to move the
getSize() == 0assertion into anawait().untilAsserted()block, similar to the pattern used intestBasic().