diff --git a/context/src/test/java/io/grpc/ContextTest.java b/context/src/test/java/io/grpc/ContextTest.java index 66b56372e6..47b9dff0a5 100644 --- a/context/src/test/java/io/grpc/ContextTest.java +++ b/context/src/test/java/io/grpc/ContextTest.java @@ -609,7 +609,7 @@ public class ContextTest { latch.countDown(); } }, MoreExecutors.directExecutor()); - latch.await(3, TimeUnit.SECONDS); + assertTrue("cancellation failed", latch.await(3, TimeUnit.SECONDS)); if (error.get() != null) { throw error.get(); } diff --git a/stub/src/test/java/io/grpc/stub/ServerCallsTest.java b/stub/src/test/java/io/grpc/stub/ServerCallsTest.java index 77e24fe522..04f8875542 100644 --- a/stub/src/test/java/io/grpc/stub/ServerCallsTest.java +++ b/stub/src/test/java/io/grpc/stub/ServerCallsTest.java @@ -498,7 +498,7 @@ public class ServerCallsTest { semaphore.acquire(); clientCall.request(3); clientCall.halfClose(); - latch.await(5, TimeUnit.SECONDS); + assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue(); // Very that number of messages produced in each onReady handler call matches the number // requested by the client. assertArrayEquals(new int[]{0, 1, 1, 2, 2, 2}, receivedMessages);