From c232df62e6b7df274419dd2437779a2c90dbeedd Mon Sep 17 00:00:00 2001 From: Rajan Dhabalia Date: Fri, 30 Jun 2017 15:28:39 -0700 Subject: [PATCH] Fix: intermittent test failure for BrokerClientIntegrationTest.testCloseBrokerService (#545) --- .../client/impl/BrokerClientIntegrationTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java index b7ca39cba13..9afbfa4fd64 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java @@ -256,7 +256,15 @@ public class BrokerClientIntegrationTest extends ProducerConsumerBase { // [1] OwnershipCache should not contain any more namespaces OwnershipCache ownershipCache = pulsar.getNamespaceService().getOwnershipCache(); assertTrue(ownershipCache.getOwnedBundles().keySet().isEmpty()); - + // Strategical retry + for (int i = 0; i < 5; i++) { + if (producer1.getClientCnx() != null || consumer1.getClientCnx() != null + || producer2.getClientCnx() != null) { + Thread.sleep(100); + } else { + break; + } + } // [2] All clients must be disconnected and in connecting state // producer1 must not be able to connect again assertTrue(producer1.getClientCnx() == null); -- GitLab