Skip to content

Commit

Permalink
Test adjustments for CI. #182
Browse files Browse the repository at this point in the history
  • Loading branch information
czyzby committed Feb 23, 2021
1 parent 442f2b1 commit 1352694
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions async/src/test/kotlin/ktx/async/dispatchersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ abstract class CoroutineDispatcherTest : AsyncTest() {
}

// Then:
assertTrue("${executionTime.get()} must be around 50 millis.", executionTime.get() in 45L..75L)
assertSame(initialThread.get(), finalThread.get())
assertNotSame(Thread.currentThread(), finalThread.get())
if (!isConcurrent) {
assertSame(executorThread, finalThread.get())
}
// Tolerance adjusted for the testing environment:
assertTrue("${executionTime.get()} must be around 50 millis.", executionTime.get() in 45L..200L)
}

@Test
Expand All @@ -94,8 +95,8 @@ abstract class CoroutineDispatcherTest : AsyncTest() {

// Then:
delay(100L)
// Increased tolerance for the testing environment:
assertTrue("${executionTime.get()} must be around 50 millis.", executionTime.get() in 45L..75L)
// Tolerance adjusted for the testing environment:
assertTrue("${executionTime.get()} must be around 50 millis.", executionTime.get() in 45L..200L)
}

@Test
Expand Down

0 comments on commit 1352694

Please sign in to comment.