apache / accumulo

Apache Accumulo
https://accumulo.apache.org
Apache License 2.0
1.07k stars 445 forks source link

Potentially Flaky test: CompactionJobQueuesTest.testGetAsync() #5005

Closed kevinrr888 closed 3 weeks ago

kevinrr888 commented 4 weeks ago

Test name(s) CompactionJobQueuesTest.testGetAsync()

Describe the failure observed GitHub actions failed on 94167151e2de1be87ac60e25751edf1b557d3a3b for this test. Thought it might have been broken by this commit, but ran locally and was not able to reproduce a failure. Reran the GH action and it passed. Failed here: https://github.com/apache/accumulo/blob/94167151e2de1be87ac60e25751edf1b557d3a3b/server/manager/src/test/java/org/apache/accumulo/manager/compaction/queue/CompactionJobQueuesTest.java#L402

Testing Environment: 4.0/main

cshannon commented 3 weeks ago

I just saw this happen for the first time locally during a build:

[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.079 s <<< FAILURE! -- in org.apache.accumulo.manager.compaction.queue.CompactionJobQueuesTest
[ERROR] org.apache.accumulo.manager.compaction.queue.CompactionJobQueuesTest.testGetAsync -- Time elapsed: 1.647 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
    at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
    at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
    at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
    at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
    at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
    at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
    at org.apache.accumulo.manager.compaction.queue.CompactionJobQueuesTest.testGetAsync(CompactionJobQueuesTest.java:402)
    at java.base/java.lang.reflect.Method.invoke(Method.java:569)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
kevinrr888 commented 3 weeks ago

@cshannon Thanks for the confirmation and stack trace. I was not able to reproduce it again.

cshannon commented 3 weeks ago

I think the root issue is that the sleep that is supposed to wait for future6 to timeout may not wait quite long enough sometimes, so future6 gets the job when added to the queue and not future7. I have a small PR to push up shortly to make the test more reliable