Browse Source

MINOR: Fix transient test failure in DynamicConnectionQuotaTest (#5544)

Reviewers: Jason Gustafson <jason@confluent.io>
pull/5543/merge
Manikumar Reddy O 6 years ago committed by Jason Gustafson
parent
commit
73f8809d99
  1. 3
      core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala

3
core/src/test/scala/integration/kafka/network/DynamicConnectionQuotaTest.scala

@ -76,6 +76,7 @@ class DynamicConnectionQuotaTest extends BaseRequestTest { @@ -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 { @@ -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()
}

Loading…
Cancel
Save