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 8e1da11 commit 442f2b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions async/src/test/kotlin/ktx/async/dispatchersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotSame
import org.junit.Assert.assertSame
import org.junit.Assert.assertTrue
import org.junit.Test

/**
Expand Down Expand Up @@ -68,7 +69,7 @@ abstract class CoroutineDispatcherTest : AsyncTest() {
}

// Then:
assert(executionTime.get() in 50L..70L)
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) {
Expand All @@ -93,7 +94,8 @@ abstract class CoroutineDispatcherTest : AsyncTest() {

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

@Test
Expand Down

0 comments on commit 442f2b1

Please sign in to comment.