Skip to content

Commit

Permalink
[Issue 12897] Fix flaky test in testReplicatorProducerName (#12898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason918 authored Nov 21, 2021
1 parent ec715f2 commit 78c2981
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,12 @@ public void testReplicatorProducerName() throws Exception {
});
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)
Expand Down

0 comments on commit 78c2981

Please sign in to comment.