eolivelli commented on a change in pull request #10337:
URL: https://github.com/apache/pulsar/pull/10337#discussion_r619406437



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentTopicTest.java
##########
@@ -156,4 +161,28 @@ public void testUnblockStuckSubscription() throws 
Exception {
         msg = consumer2.receive(5, TimeUnit.SECONDS);
         assertNotNull(msg);
     }
+
+    @Test
+    public void testDeleteNamespaceInfiniteRetry() throws Exception {
+        //init namespace
+        final String myNamespace = "prop/ns" + UUID.randomUUID();
+        admin.namespaces().createNamespace(myNamespace, 
Sets.newHashSet("test"));
+        final String topic = "persistent://" + myNamespace + 
"/testDeleteNamespaceInfiniteRetry";
+        conf.setForceDeleteNamespaceAllowed(true);
+        //init topic and policies
+        pulsarClient.newProducer().topic(topic).create().close();
+        admin.namespaces().setMaxConsumersPerTopic(myNamespace, 0);
+        Awaitility.await().atMost(3, TimeUnit.SECONDS).until(()
+                -> admin.namespaces().getMaxConsumersPerTopic(myNamespace) == 
0);
+
+        PersistentTopic persistentTopic =
+                spy((PersistentTopic) 
pulsar.getBrokerService().getTopicIfExists(topic).get().get());
+
+        admin.namespaces().deleteNamespace(myNamespace, true);
+
+        Policies policies = new Policies();
+        policies.deleted = true;
+        persistentTopic.onPoliciesUpdate(policies);
+        verify(persistentTopic, times(0)).checkReplicationAndRetryOnFailure();

Review comment:
       CN we add a positive test, that verifies that this method is called in 
case of non deleted Policies?




-- 
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.

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


Reply via email to