From 609888f4d7ee6adf25774045ecdfe6320182c358 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 10 Aug 2019 14:16:10 +0100 Subject: [PATCH] Increase timeout for flaky test (#5305) --- okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.java b/okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.java index 3e175f8174f3..bf8b54343af9 100644 --- a/okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.java +++ b/okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReference; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; +import okhttp3.testing.Flaky; import okio.BufferedSink; import org.junit.Before; import org.junit.Rule; @@ -286,7 +287,10 @@ public void timeoutFollowingRedirectOnNewConnection() throws Exception { } } + @Flaky @Test public void noTimeout() throws Exception { + // Flaky https://github.com/square/okhttp/issues/5304 + server.enqueue(new MockResponse() .setHeadersDelay(250, TimeUnit.MILLISECONDS) .setBody(BIG_ENOUGH_BODY)); @@ -297,7 +301,7 @@ public void timeoutFollowingRedirectOnNewConnection() throws Exception { .build(); Call call = client.newCall(request); - call.timeout().timeout(1000, TimeUnit.MILLISECONDS); + call.timeout().timeout(2000, TimeUnit.MILLISECONDS); Response response = call.execute(); Thread.sleep(250); response.body().source().readUtf8();