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 @@ -186,12 +186,18 @@ public void cleanup() throws Exception {
186186 }
187187
188188 @ AfterMethod (alwaysRun = true )
189- public void cleanupAfterMethod () throws Exception {
190- // cleanup.
189+ public void cleanupAfterMethod () {
190+ // Best-effort cleanup. Transient infra failures (e.g. ZK session expiry from a
191+ // long-running test or GC pause) can make the admin call fail here; log and
192+ // continue so the test method's actual result is preserved.
191193 Set <String > existsNsSetAferSetup = Stream .concat (testLocalNamespaces .stream (), testGlobalNamespaces .stream ())
192194 .map (Objects ::toString ).collect (Collectors .toSet ());
193- cleanupNamespaceByPredicate (this .testTenant , v -> !existsNsSetAferSetup .contains (v ));
194- cleanupNamespaceByPredicate (this .testOtherTenant , v -> !existsNsSetAferSetup .contains (v ));
195+ try {
196+ cleanupNamespaceByPredicate (this .testTenant , v -> !existsNsSetAferSetup .contains (v ));
197+ cleanupNamespaceByPredicate (this .testOtherTenant , v -> !existsNsSetAferSetup .contains (v ));
198+ } catch (Exception e ) {
199+ log .warn ().exception (e ).log ("Failed to clean up namespaces after test method" );
200+ }
195201 }
196202
197203 protected void customizeNewPulsarClientBuilder (ClientBuilder clientBuilder ) {
You can’t perform that action at this time.
0 commit comments