Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions okio/src/jvmTest/kotlin/okio/SocketTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import javax.net.SocketFactory
import kotlin.concurrent.thread
import kotlin.test.assertFailsWith
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds
import kotlin.time.measureTime
import okio.internal.DefaultSocket
import org.junit.jupiter.api.AfterEach
Expand Down Expand Up @@ -163,7 +164,9 @@ class SocketTest(val factory: Factory = Factory.Default) {
}
}

assertThat(duration).isBetween(250.milliseconds, 750.milliseconds)
// The upper bound only guards against a hang; a loaded CI machine can take well over the
// 500 ms timeout to deliver the interrupt.
assertThat(duration).isBetween(250.milliseconds, 2.seconds)
}

/** Make a large-enough write to saturate the outgoing write buffer. */
Expand All @@ -178,7 +181,9 @@ class SocketTest(val factory: Factory = Factory.Default) {
}
}

assertThat(duration).isBetween(250.milliseconds, 750.milliseconds)
// The upper bound only guards against a hang; a loaded CI machine can take well over the
// 500 ms timeout to deliver the interrupt.
assertThat(duration).isBetween(250.milliseconds, 2.seconds)
}

@Test
Expand Down