We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a282afe commit 1f92b82Copy full SHA for 1f92b82
java/shared/test/java/org/signal/libsignal/internal/FutureTest.java
@@ -65,6 +65,15 @@ public void testFutureFromRustCancel() {
65
"Expected CancellationException as cause",
66
e.getCause() instanceof java.util.concurrent.CancellationException);
67
assertTrue(testFuture.isCancelled());
68
+ } else {
69
+ // The future completed before we could cancel it.
70
+ // Oppurtunitically, let's just check that the future completed as expected.
71
+ try {
72
+ assertEquals(63, (int) testFuture.get());
73
+ assertFalse(testFuture.isCancelled());
74
+ } catch (ExecutionException | InterruptedException e) {
75
+ fail("testFuture.get() threw an unexpected exception: " + e.getMessage());
76
+ }
77
}
78
assertTrue(testFuture.isDone());
79
0 commit comments