1 /* <lambda>null2 * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 package kotlinx.coroutines.test 5 6 import kotlinx.coroutines.* 7 import kotlin.concurrent.* 8 import kotlin.coroutines.* 9 import kotlin.test.* 10 11 class RunTestStressTest { 12 /** Tests that notifications about asynchronous resumptions aren't lost. */ 13 @Test 14 fun testRunTestActivityNotificationsRace() { 15 val n = 1_000 * stressTestMultiplier 16 for (i in 0 until n) { 17 runTest { 18 suspendCancellableCoroutine<Unit> { cont -> 19 thread { 20 cont.resume(Unit) 21 } 22 } 23 } 24 } 25 } 26 }