File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
java/shared/test/java/org/signal/libsignal/internal Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,13 @@ public void testFutureFromRustCancel() {
5959 (nativeContextHandle ) ->
6060 NativeTesting .TESTING_TokioAsyncFuture (nativeContextHandle , 21 ))
6161 .makeCancelable (context );
62- assertTrue (testFuture .cancel (true ));
63- ExecutionException e = assertThrows (ExecutionException .class , () -> testFuture .get ());
64- assertTrue (
65- "Expected CancellationException as cause" ,
66- e .getCause () instanceof java .util .concurrent .CancellationException );
67- assertTrue (testFuture .isCancelled ());
62+ if (testFuture .cancel (true )) {
63+ ExecutionException e = assertThrows (ExecutionException .class , () -> testFuture .get ());
64+ assertTrue (
65+ "Expected CancellationException as cause" ,
66+ e .getCause () instanceof java .util .concurrent .CancellationException );
67+ assertTrue (testFuture .isCancelled ());
68+ }
6869 assertTrue (testFuture .isDone ());
6970 }
7071
You can’t perform that action at this time.
0 commit comments