--- jsr166/src/test/tck/PhaserTest.java 2017/05/13 23:05:02 1.46 +++ jsr166/src/test/tck/PhaserTest.java 2019/09/05 21:44:15 1.49 @@ -478,14 +478,14 @@ public class PhaserTest extends JSR166Te public void realRun() throws TimeoutException { 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, LONGER_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) {} assertFalse(Thread.interrupted()); @@ -493,7 +493,8 @@ public class PhaserTest extends JSR166Te await(pleaseInterrupt); assertState(phaser, 0, 1, 1); - assertThreadsStayAlive(t1, t2); + if (randomBoolean()) assertThreadBlocks(t1, Thread.State.WAITING); + if (randomBoolean()) assertThreadBlocks(t2, Thread.State.TIMED_WAITING); t1.interrupt(); t2.interrupt(); awaitTermination(t1);