We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf4fcd1 commit eac92c0Copy full SHA for eac92c0
kotlinx-coroutines-core/jvm/test/JobChildStressTest.kt
@@ -89,10 +89,14 @@ class JobChildStressTest : TestBase() {
89
launch(pool + deferred) {
90
deferred.complete(Unit) // Transition deferred into "completing" state waiting for current child
91
// **Asynchronously** submit task that launches a child so it races with completion
92
- pool.executor.execute {
93
- rogueJob.set(launch(pool + deferred) {
94
- throw TestException("isCancelled: ${coroutineContext.job.isCancelled}")
95
- })
+ try {
+ pool.executor.execute {
+ rogueJob.set(launch(pool + deferred) {
+ throw TestException("isCancelled: ${coroutineContext.job.isCancelled}")
96
+ })
97
+ }
98
+ } catch (_: RejectedExecutionException) {
99
+ // This is expected if the pool is closed
100
}
101
102
0 commit comments