gaoran10 commented on code in PR #22190:
URL: https://github.com/apache/pulsar/pull/22190#discussion_r1511176429


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceAutoSubscriptionCreationTest.java:
##########
@@ -159,15 +160,19 @@ public void 
testDynamicConfigurationTopicAutoSubscriptionCreation()
             throws PulsarAdminException, PulsarClientException {
         pulsar.getConfiguration().setAllowAutoTopicCreation(false);
         pulsar.getConfiguration().setAllowAutoSubscriptionCreation(true);
-        
admin.brokers().updateDynamicConfiguration("allowAutoSubscriptionCreation", 
"false");
+        String allowAutoSubscriptionCreation = "allowAutoSubscriptionCreation";
+        
admin.brokers().updateDynamicConfiguration(allowAutoSubscriptionCreation, 
"false");
         String topicString = "persistent://prop/ns-abc/non-partitioned-topic" 
+ UUID.randomUUID();
         String subscriptionName = "non-partitioned-topic-sub";
         admin.topics().createNonPartitionedTopic(topicString);
         Assert.assertThrows(PulsarClientException.class,
                 ()-> 
pulsarClient.newConsumer().topic(topicString).subscriptionName(subscriptionName).subscribe());
-        
admin.brokers().updateDynamicConfiguration("allowAutoSubscriptionCreation", 
"true");
-        
pulsarClient.newConsumer().topic(topicString).subscriptionName(subscriptionName).subscribe();
-        
assertTrue(admin.topics().getSubscriptions(topicString).contains(subscriptionName));
+        
admin.brokers().updateDynamicConfiguration(allowAutoSubscriptionCreation, 
"true");
+        Awaitility.await().untilAsserted(() -> {
+            
Assert.assertEquals(admin.brokers().getAllDynamicConfigurations().get(allowAutoSubscriptionCreation),
 "true");
+            
pulsarClient.newConsumer().topic(topicString).subscriptionName(subscriptionName).subscribe();

Review Comment:
   Do we need to add a try-catch for this method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to