Trying to fix flaky test

This commit is contained in:
Alexey Andreev 2017-02-16 22:33:18 +03:00
parent 60f8633acb
commit 1ea69b7d17

View File

@ -39,14 +39,14 @@ public class ThreadTest {
new Thread() { new Thread() {
@Override public void run() { @Override public void run() {
try { try {
Thread.sleep(100); Thread.sleep(50);
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }
mainThread.interrupt(); mainThread.interrupt();
} }
}.start(); }.start();
try { try {
Thread.sleep(300); Thread.sleep(500);
fail("Exception expected"); fail("Exception expected");
} catch (InterruptedException e) { } catch (InterruptedException e) {
assertEquals(Thread.currentThread(), mainThread); assertEquals(Thread.currentThread(), mainThread);