Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

synchronizer attempts to trigger different threads within timeout

  • Loading branch information...
commit f71a2d4c61beedd2bc027d525c633dd9f4413ba2 1 parent 7602636
@Tibor17 authored
View
6 src/test/java/org/junit/tests/experimental/parallel/ParallelMethodTest.java
@@ -12,8 +12,10 @@
import org.junit.Before;
import org.junit.BeforeClass;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
public class ParallelMethodTest {
+ private static final long TIMEOUT= 15;
private static volatile Thread fOne= null;
private static volatile Thread fTwo= null;
@@ -25,12 +27,12 @@
}
@Test public void one() throws InterruptedException {
fSynchronizer.countDown();
- fSynchronizer.await();
+ assertTrue(fSynchronizer.await(TIMEOUT, TimeUnit.SECONDS));
fOne= Thread.currentThread();
}
@Test public void two() throws InterruptedException {
fSynchronizer.countDown();
- fSynchronizer.await();
+ assertTrue(fSynchronizer.await(TIMEOUT, TimeUnit.SECONDS));
fTwo= Thread.currentThread();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.