File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
kotlinx-coroutines-core/jvm/test Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,14 @@ class JobChildStressTest : TestBase() {
89
89
launch(pool + deferred) {
90
90
deferred.complete(Unit ) // Transition deferred into "completing" state waiting for current child
91
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
- })
92
+ try {
93
+ pool.executor.execute {
94
+ rogueJob.set(launch(pool + deferred) {
95
+ throw TestException (" isCancelled: ${coroutineContext.job.isCancelled} " )
96
+ })
97
+ }
98
+ } catch (_: RejectedExecutionException ) {
99
+ // This is expected if the pool is closed
96
100
}
97
101
}
98
102
You can’t perform that action at this time.
0 commit comments