From 4762c84ffed9fda843c961319f20a4ee51d9025e Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 7 Dec 2023 11:03:02 -0500 Subject: [PATCH] test: increasing timeout in testOnResponseError This test is multithread because RetryingServerStreamingCallable uses an executor. This change increases the timeout in HttpJsonDirectServerStreamingCallableTest.testOnResponseError to avoid flakiness. There's no guarantee that this multithread test executes the CountDownLatch.countDown() within 2 seconds. --- .../gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java index 709220be7d..3b5312e01b 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java @@ -263,7 +263,7 @@ public void testOnResponseError() throws Throwable { MoneyObserver moneyObserver = new MoneyObserver(true, latch); streamingCallable.call(ERROR_REQUEST, moneyObserver); - Truth.assertThat(latch.await(2000, TimeUnit.MILLISECONDS)).isTrue(); + Truth.assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue(); Truth.assertThat(moneyObserver.error).isInstanceOf(ApiException.class); Truth.assertThat(((ApiException) moneyObserver.error).getStatusCode().getCode())