File tree 2 files changed +17
-17
lines changed
2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import kotlinx.coroutines.*
7
7
import kotlinx.coroutines.exceptions.*
8
8
import kotlin.test.*
9
9
10
- class LimitedParallelismSharedStressTest : TestBase () {
10
+ class LimitedParallelismConcurrentTest : TestBase () {
11
11
12
12
private val targetParallelism = 4
13
13
private val iterations = 100_000
@@ -41,4 +41,19 @@ class LimitedParallelismSharedStressTest : TestBase() {
41
41
}
42
42
}
43
43
}
44
+
45
+ @Test
46
+ fun testTaskFairness () = runTest {
47
+ val executor = newSingleThreadContext(" test" )
48
+ val view = executor.limitedParallelism(1 )
49
+ val view2 = executor.limitedParallelism(1 )
50
+ val j1 = launch(view) {
51
+ while (true ) {
52
+ yield ()
53
+ }
54
+ }
55
+ val j2 = launch(view2) { j1.cancel() }
56
+ joinAll(j1, j2)
57
+ executor.close()
58
+ }
44
59
}
Original file line number Diff line number Diff line change @@ -9,22 +9,7 @@ import java.util.concurrent.*
9
9
import kotlin.coroutines.*
10
10
import kotlin.test.*
11
11
12
- class LimitedParallelismTest : TestBase () {
13
-
14
- @Test
15
- fun testTaskFairness () = runTest {
16
- val executor = newSingleThreadContext(" test" )
17
- val view = executor.limitedParallelism(1 )
18
- val view2 = executor.limitedParallelism(1 )
19
- val j1 = launch(view) {
20
- while (true ) {
21
- yield ()
22
- }
23
- }
24
- val j2 = launch(view2) { j1.cancel() }
25
- joinAll(j1, j2)
26
- executor.close()
27
- }
12
+ class LimitedParallelismUnhandledExceptionTest : TestBase () {
28
13
29
14
@Test
30
15
fun testUnhandledException () = runTest {
You can’t perform that action at this time.
0 commit comments