diff --git a/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java b/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java index 477ee0a03..ae7b4ff41 100644 --- a/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/lang/ThreadTest.java @@ -39,23 +39,21 @@ public class ThreadTest { public void sleepInterrupted() { long start = System.currentTimeMillis(); final Thread mainThread = Thread.currentThread(); - new Thread() { - @Override public void run() { - try { - Thread.sleep(50); - } catch (InterruptedException e) { - // ok - } - mainThread.interrupt(); + new Thread(() -> { + try { + Thread.sleep(50); + } catch (InterruptedException e) { + // ok } - }.start(); + mainThread.interrupt(); + }).start(); try { - Thread.sleep(500); + Thread.sleep(5000); fail("Exception expected"); } catch (InterruptedException e) { assertEquals(Thread.currentThread(), mainThread); assertFalse(mainThread.isInterrupted()); - assertTrue(System.currentTimeMillis() - start < 150); + assertTrue(System.currentTimeMillis() - start < 500); } }