This is an automated email from the ASF dual-hosted git repository.

abukor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit fd381f19f3bee14a25962f67f3bf3e6188d78af0
Author: Andrew Wong <[email protected]>
AuthorDate: Mon Jul 20 15:13:11 2020 -0700

    KUDU-3170: deflake testSlowWriterDoesntBlockQueues
    
    Previously the test would block the writer thread for 1s, expect a
    timeout to happen within 1s, and check that the slow writer still
    allowed for the outbound queue to be inserted to.
    
    This led to some flakiness, as the first write may have sometimes
    completed within 1s and allowed the second request to leave the outbound
    queue and begin writing. This patch addresses this by extending the time
    with which we block writes to extend past the execution deadline.
    
    Without this patch, we saw frequent failures in ARM runs of the test,
    and I saw 4/400 failures in dist-test. With the patch, the test passed
    in dist-test 1600/1600 times.
    
    Change-Id: I8b322782630b3ef935fb0264b6195d2ed72cc58c
    Reviewed-on: http://gerrit.cloudera.org:8080/16221
    Reviewed-by: Grant Henke <[email protected]>
    Tested-by: Andrew Wong <[email protected]>
---
 .../java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java
 
b/java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java
index 704d036..83c0eb9 100644
--- 
a/java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java
+++ 
b/java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java
@@ -280,13 +280,14 @@ public class TestEchoSubprocess extends 
SubprocessTestUtil {
         setUpExecutorIO(NO_ERR, /*injectIOError*/false);
     sendRequestToPipe(createEchoSubprocessRequest("a"));
     sendRequestToPipe(createEchoSubprocessRequest("b"));
-    executor.blockWriteMs(1000);
+    executor.blockWriteMs(2 * TIMEOUT_MS);
     Assert.assertThrows(TimeoutException.class,
         () -> executor.run(new SubprocessConfiguration(NO_ARGS),
                            new EchoProtocolHandler(), TIMEOUT_MS));
 
-    // We should see a single message in the outbound queue. The other one is
-    // blocked writing.
+    // The MessageWriter took the first message from the outbound queue and
+    // went to sleep for 2 * TIMEOUT_MS; the second message should still be in
+    // the queue after TIMEOUT_MS.
     BlockingQueue<OutboundResponse> outboundQueue = 
executor.getOutboundQueue();
     Assert.assertEquals(1, outboundQueue.size());
   }

Reply via email to