File tree Expand file tree Collapse file tree
pulsar-broker/src/test/java/org/apache/pulsar/broker/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,8 +306,14 @@ protected void cleanupPulsarResources() throws Exception {
306306 if (!usingGlobalZK ) {
307307 admin2 .namespaces ().setNamespaceReplicationClusters (replicatedNamespace , Sets .newHashSet (cluster2 ), true );
308308 }
309- admin1 .namespaces ().deleteNamespace (replicatedNamespace , true );
310- admin1 .namespaces ().deleteNamespace (nonReplicatedNamespace , true );
309+ // When using global ZK, reducing replication clusters triggers async topic cleanup on removed clusters.
310+ // Retry namespace deletion to handle topics that may be in a transitional state.
311+ Awaitility .await ().atMost (Duration .ofSeconds (30 )).ignoreExceptions ().untilAsserted (() -> {
312+ admin1 .namespaces ().deleteNamespace (replicatedNamespace , true );
313+ });
314+ Awaitility .await ().atMost (Duration .ofSeconds (30 )).ignoreExceptions ().untilAsserted (() -> {
315+ admin1 .namespaces ().deleteNamespace (nonReplicatedNamespace , true );
316+ });
311317 if (!usingGlobalZK ) {
312318 admin2 .namespaces ().deleteNamespace (replicatedNamespace , true );
313319 admin2 .namespaces ().deleteNamespace (nonReplicatedNamespace , true );
You can’t perform that action at this time.
0 commit comments