You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/11/21 04:50:22 UTC

[pulsar] branch master updated: [Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)

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

penghui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 78c2981  [Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)
78c2981 is described below

commit 78c2981a8bc0af4ee883357b99a40e83be8ffa4b
Author: JiangHaiting <ji...@apache.org>
AuthorDate: Sun Nov 21 12:49:15 2021 +0800

    [Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)
---
 .../java/org/apache/pulsar/broker/service/ReplicatorTest.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
index 61011c9..a19448c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
@@ -724,10 +724,12 @@ public class ReplicatorTest extends ReplicatorTestBase {
         });
         Optional<Topic> topic = pulsar2.getBrokerService().getTopicReference(topicName);
         assertTrue(topic.isPresent());
-        Set<String> remoteClusters = topic.get().getProducers().values().stream()
-                .map(org.apache.pulsar.broker.service.Producer::getRemoteCluster)
-                .collect(Collectors.toSet());
-        assertTrue(remoteClusters.contains("r1"));
+        Awaitility.await().untilAsserted(() -> {
+            Set<String> remoteClusters = topic.get().getProducers().values().stream()
+                    .map(org.apache.pulsar.broker.service.Producer::getRemoteCluster)
+                    .collect(Collectors.toSet());
+            assertTrue(remoteClusters.contains("r1"));
+        });
     }
 
     @Test(priority = 5, timeOut = 30000)