8889909192939495969798
// Need to wait complete to be called first or the test would be invalid. // We use a latch instead of forcing a sleep here Assert.assertTrue(latch.await(5, TimeUnit.SECONDS)); impl.done(); t.join(); Assert.assertEquals(1, numberOfFailures.get()); }
8687888990919293949596
}); assertFalse(latch2.await(1, TimeUnit.MILLISECONDS)); for (int i = 0 ; i < 9; i++) impl.done(); for (int i = 0 ; i < 2; i++) impl.pageSyncDone(); assertFalse(latch2.await(1, TimeUnit.MILLISECONDS));
9293949596979899100101102
for (int i = 0 ; i < 2; i++) impl.pageSyncDone(); assertFalse(latch2.await(1, TimeUnit.MILLISECONDS)); impl.done(); impl.pageSyncDone(); assertTrue(latch2.await(10, TimeUnit.SECONDS)); }
149150151152153154155156157158159