You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/07 15:31:12 UTC

[GitHub] [pulsar] 315157973 commented on a diff in pull request #15141: [pulsar-broker] Fix delete empty namespace with partitioned-topic metadata

315157973 commented on code in PR #15141:
URL: https://github.com/apache/pulsar/pull/15141#discussion_r964994695


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java:
##########
@@ -2431,4 +2431,27 @@ public void testPartitionedStatsAggregationByProducerNamePerPartition(String top
         assertEquals(topicStats.getPublishers().size(), 2);
         topicStats.getPublishers().forEach(p -> assertTrue(p.isSupportsPartialProducer()));
     }
+
+    @Test
+    public void testDeleteNamespaceWithDeletedPartitionedTopic() throws Exception {
+        final String namespace = "prop-xyz/ns-delete";
+        admin.namespaces().createNamespace(namespace);
+        final String topicName = "persistent://" + namespace + "/delete-ns-topic";
+        admin.topics().createPartitionedTopic(topicName, 10);
+        List<String> topics = pulsar.getPulsarResources().getTopicResources()
+                .listPersistentTopicsAsync(NamespaceName.get(namespace)).get();
+        topics.forEach(topic -> {
+            try {
+                admin.topics().delete(topic);
+            } catch (PulsarAdminException e) {
+                fail("should not fail to delete");
+            }
+        });
+        admin.namespaces().deleteNamespace(namespace);
+        try {
+            admin.namespaces().getPolicies(namespace);

Review Comment:
   There must be an exception, so a `fail()` should be added here



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org