Skip to content

Commit 863258b

Browse files
committed
Fixed RejectedExecutionTest on JDK1.6
1 parent 1b34e1c commit 863258b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kotlinx-coroutines-core/jvm/test/RejectedExecutionTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package kotlinx.coroutines
66

77
import kotlinx.coroutines.flow.*
8+
import kotlinx.coroutines.internal.*
89
import kotlinx.coroutines.scheduling.*
910
import org.junit.*
1011
import org.junit.Test
@@ -89,6 +90,7 @@ class RejectedExecutionTest : TestBase() {
8990

9091
@Test
9192
fun testRejectOnDelay() = runTest {
93+
if (!removeFutureOnCancel(executor)) return@runTest // Skip this test on old JDKs
9294
expect(1)
9395
executor.acceptTasks = 1 // accept one task
9496
assertFailsWith<CancellationException> {
@@ -110,6 +112,7 @@ class RejectedExecutionTest : TestBase() {
110112

111113
@Test
112114
fun testRejectWithTimeout() = runTest {
115+
if (!removeFutureOnCancel(executor)) return@runTest // Skip this test on old JDKs
113116
expect(1)
114117
executor.acceptTasks = 1 // accept one task
115118
assertFailsWith<CancellationException> {

0 commit comments

Comments
 (0)