Skip to content

Commit

Permalink
Update binary compatibility validator (#2969)
Browse files Browse the repository at this point in the history
* Update binary compatibility validator
* Fix race in testFuturePropagatesExceptionToParentAfterCancellation
  • Loading branch information
qwwdfsad committed Oct 5, 2021
1 parent 60eefec commit 1ba202d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -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

Expand Down
Expand Up @@ -756,19 +756,22 @@ class ListenableFutureTest : TestBase() {
}

@Test
fun futurePropagatesExceptionToParentAfterCancellation() = runTest {
val latch = CompletableDeferred<Boolean>()
fun testFuturePropagatesExceptionToParentAfterCancellation() = runTest {
val throwLatch = CompletableDeferred<Boolean>()
val cancelLatch = CompletableDeferred<Boolean>()
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)
Expand Down

0 comments on commit 1ba202d

Please sign in to comment.