File tree 2 files changed +8
-5
lines changed
integration/kotlinx-coroutines-guava/test
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ rxjava2_version=2.2.8
22
22
rxjava3_version =3.0.2
23
23
javafx_version =11.0.2
24
24
javafx_plugin_version =0.0.8
25
- binary_compatibility_validator_version =0.7.0
25
+ binary_compatibility_validator_version =0.8.0-RC
26
26
blockhound_version =1.0.2.RELEASE
27
27
jna_version =5.5.0
28
28
Original file line number Diff line number Diff line change @@ -756,19 +756,22 @@ class ListenableFutureTest : TestBase() {
756
756
}
757
757
758
758
@Test
759
- fun futurePropagatesExceptionToParentAfterCancellation () = runTest {
760
- val latch = CompletableDeferred <Boolean >()
759
+ fun testFuturePropagatesExceptionToParentAfterCancellation () = runTest {
760
+ val throwLatch = CompletableDeferred <Boolean >()
761
+ val cancelLatch = CompletableDeferred <Boolean >()
761
762
val parent = Job ()
762
763
val scope = CoroutineScope (parent)
763
764
val exception = TestException (" propagated to parent" )
764
765
val future = scope.future {
766
+ cancelLatch.complete(true )
765
767
withContext(NonCancellable ) {
766
- latch .await()
768
+ throwLatch .await()
767
769
throw exception
768
770
}
769
771
}
772
+ cancelLatch.await()
770
773
future.cancel(true )
771
- latch .complete(true )
774
+ throwLatch .complete(true )
772
775
parent.join()
773
776
assertTrue(parent.isCancelled)
774
777
assertEquals(exception, parent.getCancellationException().cause)
You can’t perform that action at this time.
0 commit comments