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() {
8989 launch(pool + deferred) {
9090 deferred.complete(Unit ) // Transition deferred into "completing" state waiting for current child
9191 // **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
96100 }
97101 }
98102
You can’t perform that action at this time.
0 commit comments