aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-08-23 23:55:41 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-08-23 23:55:41 +0000
commitffe1b7dc19f3fbe1bc4a5f4f1e28c64cd68c5371 (patch)
tree747e5be83c6e6a2e2d9a164ebd03c5e45e6ec952 /kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt
parent2bbecd60d31b5d0b48847f67e741018f5ae7aa07 (diff)
parent531d55eaeac09ad6cde55687ef802d4235040985 (diff)
downloadplatform_external_kotlinx.coroutines-ffe1b7dc19f3fbe1bc4a5f4f1e28c64cd68c5371.tar.gz
platform_external_kotlinx.coroutines-ffe1b7dc19f3fbe1bc4a5f4f1e28c64cd68c5371.tar.bz2
platform_external_kotlinx.coroutines-ffe1b7dc19f3fbe1bc4a5f4f1e28c64cd68c5371.zip
Snap for 7668063 from 531d55eaeac09ad6cde55687ef802d4235040985 to simpleperf-releasesimpleperf-release
Change-Id: I844c9c61f2e31a265c36a483e1509e0e08c508d6
Diffstat (limited to 'kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt')
-rw-r--r--kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt31
1 files changed, 2 insertions, 29 deletions
diff --git a/kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt b/kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt
index f52f8b5b..2d8c0ebc 100644
--- a/kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt
+++ b/kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryChannelsTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
+ * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.coroutines.exceptions
@@ -38,13 +38,6 @@ class StackTraceRecoveryChannelsTest : TestBase() {
}
@Test
- fun testReceiveOrNullFromClosedChannel() = runTest {
- val channel = Channel<Int>()
- channel.close(RecoverableTestException())
- channelReceiveOrNull(channel)
- }
-
- @Test
fun testSendToClosedChannel() = runTest {
val channel = Channel<Int>()
channel.close(RecoverableTestException())
@@ -67,7 +60,6 @@ class StackTraceRecoveryChannelsTest : TestBase() {
}
private suspend fun channelReceive(channel: Channel<Int>) = channelOp { channel.receive() }
- private suspend fun channelReceiveOrNull(channel: Channel<Int>) = channelOp { channel.receiveOrNull() }
private suspend inline fun channelOp(block: () -> Unit) {
try {
@@ -145,25 +137,6 @@ class StackTraceRecoveryChannelsTest : TestBase() {
deferred.await()
}
- // See https://github.com/Kotlin/kotlinx.coroutines/issues/950
- @Test
- fun testCancelledOffer() = runTest {
- expect(1)
- val job = Job()
- val actor = actor<Int>(job, Channel.UNLIMITED) {
- consumeEach {
- expectUnreached() // is cancelled before offer
- }
- }
- job.cancel()
- try {
- actor.offer(1)
- } catch (e: Exception) {
- verifyStackTrace("channels/${name.methodName}", e)
- finish(2)
- }
- }
-
private suspend fun Channel<Int>.sendWithContext(ctx: CoroutineContext) = withContext(ctx) {
sendInChannel()
yield() // TCE
@@ -177,4 +150,4 @@ class StackTraceRecoveryChannelsTest : TestBase() {
private suspend fun Channel<Int>.sendFromScope() = coroutineScope {
sendWithContext(wrapperDispatcher(coroutineContext))
}
-} \ No newline at end of file
+}