Add test which indicates problem with supervision
diff --git a/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt b/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
index 02a58ca..e3d0645 100644
--- a/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
@@ -107,6 +107,26 @@
}
@Test
+ fun testSupervisorFlaw() = runTest {
+ try {
+ supervisorScope {
+ expect(1)
+ launch {
+ // Test exception from supervisor is handled by launch though it clearly will be rethtown by supervisorScope{}
+ expect(2)
+ delay(Long.MAX_VALUE)
+ }
+
+ yield()
+ expect(3)
+ throw TestException1()
+ }
+ } catch (e: TestException1) {
+ finish(4)
+ }
+ }
+
+ @Test
fun testSupervisorWithParentCancelNormally() {
val parent = Job()
val supervisor = SupervisorJob(parent)