non-deterministic test failure in AsyncBufferedIteratorTest #776

Open
lbergelson opened this Issue Jan 4, 2017 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

lbergelson commented Jan 4, 2017

I'm seeing a random failure of AsynchBufferedIteratorTest.testBackground blocks.

htsjdk.samtools.util.AsyncBufferedIteratorTest.testBackgroundBlocks FAILED
    java.lang.AssertionError: expected [9] but found [0]
        at org.testng.Assert.fail(Assert.java:94)
        at org.testng.Assert.failNotEquals(Assert.java:496)
        at org.testng.Assert.assertEquals(Assert.java:125)
        at org.testng.Assert.assertEquals(Assert.java:372)
        at org.testng.Assert.assertEquals(Assert.java:382)
        at htsjdk.samtools.util.AsyncBufferedIteratorTest.testBackgroundBlocks(AsyncBufferedIteratorTest.java:79)

The test has a comment saying that it's subject to race conditions.

  Thread.sleep(10); // how do we write this test and not be subject to race conditions?
        // should have read 9 records: 2*3 in the buffers, and another 3 read but
        // blocking waiting to be added 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment