From 1ba202def4a2f35934e23dbecc950768677fb6b8 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Tue, 5 Oct 2021 18:03:15 +0300 Subject: [PATCH] Update binary compatibility validator (#2969) * Update binary compatibility validator * Fix race in testFuturePropagatesExceptionToParentAfterCancellation --- gradle.properties | 2 +- .../test/ListenableFutureTest.kt | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 26e5147c51..46eef4d76e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ rxjava2_version=2.2.8 rxjava3_version=3.0.2 javafx_version=11.0.2 javafx_plugin_version=0.0.8 -binary_compatibility_validator_version=0.7.0 +binary_compatibility_validator_version=0.8.0-RC blockhound_version=1.0.2.RELEASE jna_version=5.5.0 diff --git a/integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt b/integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt index 581e09abdd..511b1b0322 100644 --- a/integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt +++ b/integration/kotlinx-coroutines-guava/test/ListenableFutureTest.kt @@ -756,19 +756,22 @@ class ListenableFutureTest : TestBase() { } @Test - fun futurePropagatesExceptionToParentAfterCancellation() = runTest { - val latch = CompletableDeferred() + fun testFuturePropagatesExceptionToParentAfterCancellation() = runTest { + val throwLatch = CompletableDeferred() + val cancelLatch = CompletableDeferred() val parent = Job() val scope = CoroutineScope(parent) val exception = TestException("propagated to parent") val future = scope.future { + cancelLatch.complete(true) withContext(NonCancellable) { - latch.await() + throwLatch.await() throw exception } } + cancelLatch.await() future.cancel(true) - latch.complete(true) + throwLatch.complete(true) parent.join() assertTrue(parent.isCancelled) assertEquals(exception, parent.getCancellationException().cause)