[Issue 12897] Fix flaky test in testReplicatorProducerName
@@ -724,10 +724,12 @@ public class ReplicatorTest extends ReplicatorTestBase {
});
Optional<Topic> topic = pulsar2.getBrokerService().getTopicReference(topicName);
assertTrue(topic.isPresent());
+ 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)
