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 6072bbcdf..d2c62b990 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 @@ -51,9 +51,10 @@ public class ThreadTest { Thread.sleep(5000); fail("Exception expected"); } catch (InterruptedException e) { + long end = System.currentTimeMillis(); assertEquals(Thread.currentThread(), mainThread); assertFalse(mainThread.isInterrupted()); - assertTrue(System.currentTimeMillis() - start < 500); + assertTrue("Wait time " + (end - start), end - start < 5000); } } diff --git a/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java b/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java index 2e5d14611..d6103dcf8 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/concurrent/ArrayBlockingQueueTest.java @@ -102,7 +102,7 @@ public class ArrayBlockingQueueTest { long start = System.currentTimeMillis(); queue.put(3); long end = System.currentTimeMillis(); - assertTrue("Wait time " + (end - start), start + 50 < end && start + 500 > end); + assertTrue("Wait time " + (end - start), start + 50 < end && start + 5000 > end); assertEquals(3, queue.remove().intValue()); } @@ -127,7 +127,7 @@ public class ArrayBlockingQueueTest { long end = System.currentTimeMillis(); int b = queue.take(); - assertTrue("Wait time " + (end - start), start + 100 < end && start + 900 > end); + assertTrue("Wait time " + (end - start), start + 100 < end && start + 5000 > end); assertEquals(1, a); assertEquals(2, b); }