From 73f8809d99f1ab2db83580715c2e7e8ef3448c24 Mon Sep 17 00:00:00 2001 From: Manikumar Reddy O Date: Wed, 22 Aug 2018 01:45:23 +0530 Subject: [PATCH] MINOR: Fix transient test failure in DynamicConnectionQuotaTest (#5544) Reviewers: Jason Gustafson --- .../integration/kafka/network/DynamicConnectionQuotaTest.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala b/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala index 374556bda22..78d9af7bdfc 100644 --- a/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala +++ b/core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala @@ -76,6 +76,7 @@ class DynamicConnectionQuotaTest extends BaseRequestTest { val (tp, partitionResponse) = produceResponse.responses.asScala.head assertEquals(Errors.NONE, partitionResponse.error) + TestUtils.waitUntilTrue(() => connectionCount == (maxConnectionsPerIP - 1), "produce request connection is not closed") conns = conns :+ connect(socketServer) // now try one more (should fail) intercept[IOException](sendProduceRequest()) @@ -100,12 +101,14 @@ class DynamicConnectionQuotaTest extends BaseRequestTest { val (tp1, partitionResponse1) = produceResponse.responses.asScala.head assertEquals(Errors.NONE, partitionResponse1.error) + TestUtils.waitUntilTrue(() => connectionCount == (maxConnectionsPerIPOverride - 1), "produce request connection is not closed") conns = conns :+ connect(socketServer) // now try one more (should fail) intercept[IOException](sendProduceRequest()) //close one connection conns.head.close() + TestUtils.waitUntilTrue(() => connectionCount == (maxConnectionsPerIPOverride - 1), "connection is not closed") // send should succeed sendProduceRequest() }