NO-JIRA fixing TimedBufferTest

This commit is contained in:
Clebert Suconic 2017-08-19 12:48:34 -04:00
parent 4f8b4d054d
commit 27d37b735d
1 changed files with 4 additions and 1 deletions

View File

@ -208,7 +208,10 @@ public class TimedBufferTest extends ActiveMQTestBase {
Assert.assertTrue(latchFlushed.await(5, TimeUnit.SECONDS));
// The purpose of the timed buffer is to batch writes up to a millisecond.. or up to the size of the buffer.
Assert.assertTrue("Timed Buffer is not batching accordingly, it was expected to take at least 500 seconds batching multiple writes while it took " + (System.currentTimeMillis() - time) + " milliseconds", System.currentTimeMillis() - time >= 500);
Assert.assertTrue("Timed Buffer is not batching accordingly, it was expected to take at least 500 seconds batching multiple writes while it took " + (System.currentTimeMillis() - time) + " milliseconds", System.currentTimeMillis() - time >= 450);
// ^^ there are some discounts that can happen inside the timed buffer that are still considered valid (like discounting the time it took to perform the operation itself
// for that reason the test has been failing (before this commit) at 499 or 480 milliseconds. So, I'm using a reasonable number close to 500 milliseconds that would still be valid for the test
// it should be in fact only writing once..
// i will set for 3 just in case there's a GC or anything else happening on the test