--- a/test/jdk/java/util/concurrent/tck/FutureTaskTest.java Sat Sep 14 11:26:26 2019 -0700
+++ b/test/jdk/java/util/concurrent/tck/FutureTaskTest.java Sat Sep 14 11:26:26 2019 -0700
@@ -747,7 +747,7 @@
/**
* get is interruptible
*/
- public void testGet_interruptible() {
+ public void testGet_Interruptible() {
final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
final FutureTask task = new FutureTask(new NoOpCallable());
Thread t = newStartedThread(new CheckedRunnable() {
@@ -776,27 +776,28 @@
/**
* timed get is interruptible
*/
- public void testTimedGet_interruptible() {
+ public void testTimedGet_Interruptible() {
final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
final FutureTask task = new FutureTask(new NoOpCallable());
Thread t = newStartedThread(new CheckedRunnable() {
public void realRun() throws Exception {
Thread.currentThread().interrupt();
try {
- task.get(2*LONG_DELAY_MS, MILLISECONDS);
+ task.get(randomTimeout(), randomTimeUnit());
shouldThrow();
} catch (InterruptedException success) {}
assertFalse(Thread.interrupted());
pleaseInterrupt.countDown();
try {
- task.get(2*LONG_DELAY_MS, MILLISECONDS);
+ task.get(LONGER_DELAY_MS, MILLISECONDS);
shouldThrow();
} catch (InterruptedException success) {}
assertFalse(Thread.interrupted());
}});
await(pleaseInterrupt);
+ if (randomBoolean()) assertThreadBlocks(t, Thread.State.TIMED_WAITING);
t.interrupt();
awaitTermination(t);
checkNotDone(task);