You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by da...@apache.org on 2022/03/08 18:13:44 UTC

[kafka] branch 3.0 updated: MINOR: Fix flaky test cases SocketServerTest.remoteCloseWithoutBufferedReceives and SocketServerTest.remoteCloseWithIncompleteBufferedReceive (#11861)

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

dajac pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new f5feb3c  MINOR: Fix flaky test cases SocketServerTest.remoteCloseWithoutBufferedReceives and SocketServerTest.remoteCloseWithIncompleteBufferedReceive (#11861)
f5feb3c is described below

commit f5feb3c872ad63f70b8f7e8dcd8c3c75a37f76b1
Author: Vincent Jiang <84...@users.noreply.github.com>
AuthorDate: Tue Mar 8 10:03:11 2022 -0800

    MINOR: Fix flaky test cases SocketServerTest.remoteCloseWithoutBufferedReceives and SocketServerTest.remoteCloseWithIncompleteBufferedReceive (#11861)
    
    When a socket is closed, corresponding channel should be retained only if there is complete buffered requests.
    
    Reviewers: David Jacot <dj...@confluent.io>
---
 core/src/test/scala/unit/kafka/network/SocketServerTest.scala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/src/test/scala/unit/kafka/network/SocketServerTest.scala b/core/src/test/scala/unit/kafka/network/SocketServerTest.scala
index 7c35811..b06117b 100644
--- a/core/src/test/scala/unit/kafka/network/SocketServerTest.scala
+++ b/core/src/test/scala/unit/kafka/network/SocketServerTest.scala
@@ -1513,7 +1513,9 @@ class SocketServerTest {
         // Step 3: Process the first request. Verify that the channel is not removed since the channel
         // should be retained to process buffered data.
         processRequestNoOpResponse(testableServer.dataPlaneRequestChannel, request1)
-        assertSame(channel, openOrClosingChannel(request1, testableServer).getOrElse(throw new IllegalStateException("Channel closed too early")))
+        if (numComplete > 0) {
+          assertSame(channel, openOrClosingChannel(request1, testableServer).getOrElse(throw new IllegalStateException("Channel closed too early")))
+        }
 
         // Step 4: Process buffered data. if `responseRequiredIndex>=0`, the channel should be failed and removed when
         // attempting to send response. Otherwise, the channel should be removed when all completed buffers are processed.