From 1fd14137cbd20154cc1dffda342f5f75ea0d428a Mon Sep 17 00:00:00 2001 From: Luca Tassinari Date: Tue, 5 Mar 2024 00:23:46 +0100 Subject: [PATCH] test: remove duplicate test --- .../github/tassiLuca/dse/CancellationTest.kt | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 commons/src/test/kotlin/io/github/tassiLuca/dse/CancellationTest.kt diff --git a/commons/src/test/kotlin/io/github/tassiLuca/dse/CancellationTest.kt b/commons/src/test/kotlin/io/github/tassiLuca/dse/CancellationTest.kt deleted file mode 100644 index 9661951a..00000000 --- a/commons/src/test/kotlin/io/github/tassiLuca/dse/CancellationTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -package io.github.tassiLuca.dse - -import io.kotest.core.spec.style.FunSpec -import io.kotest.matchers.shouldBe -import kotlinx.coroutines.async -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking - -class CancellationTest : FunSpec({ - test("In a coroutineScope, if a coroutine throw an exception, all other coroutines are cancelled") { - var terminated = false - val result = runCatching { - runBlocking { - val f1 = launch { delay(5_000); terminated = true } - val f2 = async { delay(1_000); throw Exception("Error") } - // despite joining f1 first, this will not complete because f2 throws an exception before - f1.join() - f2.await() - } - } - result.isFailure shouldBe true - terminated shouldBe false - } -})