This test failed on Travis while building https://github.com/joshua-g/c5/commit/d08912795a57d00bbfd3c1658e5ad73368c63261 . It is nondeterministic. This test overwrites a randomly-generated byte with zero and tries to check for the resulting CRC error. That strategy will clearly fail if the byte happened to already be zero -- 1/256 of the time. Better to just check what the value is and increment it.
logThrowsAnExceptionIfDetectingCorruptedContentWhenReading(c5db.log.LogPersistenceErrorTest) Time elapsed: 0.013 sec <<< FAILURE!
java.lang.AssertionError: Expected exception: c5db.log.EntryEncodingUtil$CrcError
at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:32)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
This test failed on Travis while building https://github.com/joshua-g/c5/commit/d08912795a57d00bbfd3c1658e5ad73368c63261 . It is nondeterministic. This test overwrites a randomly-generated byte with zero and tries to check for the resulting CRC error. That strategy will clearly fail if the byte happened to already be zero -- 1/256 of the time. Better to just check what the value is and increment it.
logThrowsAnExceptionIfDetectingCorruptedContentWhenReading(c5db.log.LogPersistenceErrorTest) Time elapsed: 0.013 sec <<< FAILURE! java.lang.AssertionError: Expected exception: c5db.log.EntryEncodingUtil$CrcError at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:32) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)