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

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


The following commit(s) were added to refs/heads/3.2 by this push:
     new d1d3b5a486a MINOR: Fix flaky 
testClientDisconnectionUpdatesRequestMetrics() (#11987) (#12957)
d1d3b5a486a is described below

commit d1d3b5a486a549d6d35c26fb5e88b868a92b34e4
Author: Anastasia Vela <[email protected]>
AuthorDate: Wed Feb 22 10:43:12 2023 -0800

    MINOR: Fix flaky testClientDisconnectionUpdatesRequestMetrics() (#11987) 
(#12957)
    
    Reviewers: David Jacot <[email protected]>
---
 core/src/test/scala/unit/kafka/network/SocketServerTest.scala | 2 +-
 1 file changed, 1 insertion(+), 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 33d15ad10b5..3be2664338b 100644
--- a/core/src/test/scala/unit/kafka/network/SocketServerTest.scala
+++ b/core/src/test/scala/unit/kafka/network/SocketServerTest.scala
@@ -1124,12 +1124,12 @@ class SocketServerTest {
 
       val requestMetrics = channel.metrics(request.header.apiKey.name)
       def totalTimeHistCount(): Long = requestMetrics.totalTimeHist.count
+      val expectedTotalTimeCount = totalTimeHistCount() + 1
       val send = new NetworkSend(request.context.connectionId, 
ByteBufferSend.sizePrefixed(ByteBuffer.allocate(responseBufferSize)))
       val headerLog = new ObjectNode(JsonNodeFactory.instance)
       headerLog.set("response", new TextNode("someResponse"))
       channel.sendResponse(new RequestChannel.SendResponse(request, send, 
Some(headerLog), None))
 
-      val expectedTotalTimeCount = totalTimeHistCount() + 1
       TestUtils.waitUntilTrue(() => totalTimeHistCount() == 
expectedTotalTimeCount,
         s"request metrics not updated, expected: $expectedTotalTimeCount, 
actual: ${totalTimeHistCount()}")
 

Reply via email to