File tree Expand file tree Collapse file tree
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,16 +175,11 @@ void setupTestTopic() throws Exception {
175175 } catch (PulsarAdminException .NotFoundException e ) {
176176 // topic may already be deleted
177177 }
178- try {
179- admin .namespaces ().deleteNamespace (myNamespace , true );
180- } catch (PulsarAdminException .NotFoundException e ) {
181- // namespace may already be deleted
182- }
183- try {
184- admin .namespaces ().deleteNamespace (myNamespaceV1 , true );
185- } catch (PulsarAdminException .NotFoundException e ) {
186- // namespace may already be deleted
187- }
178+ // Use deleteNamespaceWithRetry since the forced namespace deletion can fail transiently with HTTP 422 when a
179+ // topic deletion in the cascade races with concurrent topic loading; the helper retries and treats an
180+ // already-deleted namespace as success.
181+ deleteNamespaceWithRetry (myNamespace , true );
182+ deleteNamespaceWithRetry (myNamespaceV1 , true );
188183 admin .namespaces ().createNamespace (testTenant + "/" + testNamespace , Set .of ("test" ));
189184 admin .namespaces ().createNamespace (myNamespaceV1 );
190185 admin .topics ().createPartitionedTopic (testTopic , testTopicPartitions );
You can’t perform that action at this time.
0 commit comments