--- jsr166/src/test/tck/PhaserTest.java 2017/05/14 03:07:53 1.47 +++ jsr166/src/test/tck/PhaserTest.java 2019/08/11 22:29:27 1.48 @@ -476,19 +476,23 @@ public class PhaserTest extends JSR166Te Thread t2 = newStartedThread(new CheckedRunnable() { public void realRun() throws TimeoutException { + long startTime = System.nanoTime(); + Thread.currentThread().interrupt(); try { - phaser.awaitAdvanceInterruptibly(0, 2*LONG_DELAY_MS, MILLISECONDS); + phaser.awaitAdvanceInterruptibly(0, randomTimeout(), randomTimeUnit()); shouldThrow(); } catch (InterruptedException success) {} assertFalse(Thread.interrupted()); pleaseInterrupt.countDown(); try { - phaser.awaitAdvanceInterruptibly(0, 2*LONG_DELAY_MS, MILLISECONDS); + phaser.awaitAdvanceInterruptibly(0, LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} assertFalse(Thread.interrupted()); + + assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); }}); await(pleaseInterrupt);