@@ -176,7 +176,7 @@ class ChannelUndeliveredElementStressTest(private val kind: TestChannelKind) : T
176176
177177 private suspend fun stopSender () {
178178 stoppedSender++
179- sender.cancel ()
179+ sender.cancelAndJoin ()
180180 senderDone.receive()
181181 }
182182
@@ -224,7 +224,7 @@ class ChannelUndeliveredElementStressTest(private val kind: TestChannelKind) : T
224224 private val firstFailedToDeliverOrReceivedCallTrace = atomic<Exception ?>(null )
225225
226226 fun failedToDeliver () {
227- val trace = if (TRACING_ENABLED ) Exception (" First onUndeliveredElement() call" ) else DUMMY_TRACING_EXCEPTION
227+ val trace = if (TRACING_ENABLED ) Exception (" First onUndeliveredElement() call" ) else DUMMY_TRACE_EXCEPTION
228228 if (firstFailedToDeliverOrReceivedCallTrace.compareAndSet(null , trace)) {
229229 failedToDeliverCnt.incrementAndGet()
230230 failedStatus[x] = 1
@@ -234,7 +234,7 @@ class ChannelUndeliveredElementStressTest(private val kind: TestChannelKind) : T
234234 }
235235
236236 fun onReceived () {
237- val trace = if (TRACING_ENABLED ) Exception (" First onReceived() call" ) else DUMMY_TRACING_EXCEPTION
237+ val trace = if (TRACING_ENABLED ) Exception (" First onReceived() call" ) else DUMMY_TRACE_EXCEPTION
238238 if (firstFailedToDeliverOrReceivedCallTrace.compareAndSet(null , trace)) return
239239 throw IllegalStateException (" onUndeliveredElement()/onReceived() notified twice" , firstFailedToDeliverOrReceivedCallTrace.value!! )
240240 }
@@ -265,5 +265,5 @@ class ChannelUndeliveredElementStressTest(private val kind: TestChannelKind) : T
265265 }
266266}
267267
268- private const val TRACING_ENABLED = false // Change to `true` to enable tracing while
269- private val DUMMY_TRACING_EXCEPTION = Exception (" The tracing is disabled; please enable it by changing the `TRACING_ENABLED` constant to `true`." )
268+ private const val TRACING_ENABLED = false // Change to `true` to enable the tracing
269+ private val DUMMY_TRACE_EXCEPTION = Exception (" The tracing is disabled; please enable it by changing the `TRACING_ENABLED` constant to `true`." )
0 commit comments