Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
315157973 committed Nov 3, 2021
1 parent 86fc366 commit 93a0ff1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ public class ReplicatorTopicPoliciesTest extends ReplicatorTestBase {
@BeforeClass(alwaysRun = true, timeOut = 300000)
public void setup() throws Exception {
config1.setSystemTopicEnabled(true);
config1.setDefaultNumberOfNamespaceBundles(1);
config1.setTopicLevelPoliciesEnabled(true);
config2.setSystemTopicEnabled(true);
config2.setTopicLevelPoliciesEnabled(true);
config2.setDefaultNumberOfNamespaceBundles(1);
config3.setSystemTopicEnabled(true);
config3.setTopicLevelPoliciesEnabled(true);
config3.setDefaultNumberOfNamespaceBundles(1);
super.setup();
admin1.namespaces().removeBacklogQuota("pulsar/ns");
admin1.namespaces().removeBacklogQuota("pulsar/ns1");
Expand All @@ -60,7 +63,7 @@ public void cleanup() throws Exception {
@Test
public void testReplicatorTopicPolicies() throws Exception {
final String namespace = "pulsar/partitionedNs-" + UUID.randomUUID();
final String persistentTopicName = "persistent://" + namespace + "/partTopic" + UUID.randomUUID();
final String persistentTopicName = "persistent://" + namespace + "/topic" + UUID.randomUUID();

admin1.namespaces().createNamespace(namespace);
admin1.namespaces().setNamespaceReplicationClusters(namespace, Sets.newHashSet("r1", "r2", "r3"));
Expand All @@ -77,9 +80,6 @@ public void testReplicatorTopicPolicies() throws Exception {
admin3.topics().getPartitionedTopicList(namespace).get(0), persistentTopicName));

//init topic policies server
pulsar1.getClient().newProducer().topic(persistentTopicName).create().close();
pulsar2.getClient().newProducer().topic(persistentTopicName).create().close();
pulsar3.getClient().newProducer().topic(persistentTopicName).create().close();
Awaitility.await().ignoreExceptions().untilAsserted(() -> {
assertNull(pulsar1.getTopicPoliciesService().getTopicPolicies(TopicName.get(persistentTopicName)));
assertNull(pulsar2.getTopicPoliciesService().getTopicPolicies(TopicName.get(persistentTopicName)));
Expand Down

0 comments on commit 93a0ff1

Please sign in to comment.