Skip to content

[fix][test] Make NamespacesTest.cleanupAfterMethod tolerant of transient infra failures#25641

Merged
lhotari merged 1 commit intoapache:masterfrom
merlimat:fix-flaky-namespaces-test-cleanup
May 1, 2026
Merged

[fix][test] Make NamespacesTest.cleanupAfterMethod tolerant of transient infra failures#25641
lhotari merged 1 commit intoapache:masterfrom
merlimat:fix-flaky-namespaces-test-cleanup

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented May 1, 2026

Summary

The @AfterMethod cleanup calls admin.namespaces().getNamespaces(tenant). Under load (long-running test method, GC pause) the broker's ZK session can expire and that call returns a 500. The actual test method had already passed at that point, so masking the result with a cleanup exception isn't useful.

Wrap the cleanup in try/catch + warn-log. Subsequent test methods either recover (ZK reconnects) or fail-fast with a clearer error than a session-expired stack trace from a teardown hook.

Test plan

  • testCreateNamespaces passes locally with the change applied
  • CI is green

…ent infra failures

The @AfterMethod cleanup calls admin.namespaces().getNamespaces(tenant);
under load (long-running test method, GC pause) the broker's ZK session
can expire and that call returns a 500. The actual test method had
already passed at that point, so masking the result with a cleanup
exception isn't useful.

Wrap cleanup in try/catch + warn-log. Subsequent test methods either
recover (ZK reconnects) or fail-fast with a clearer error than a
session-expired stack trace from a teardown hook.
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lhotari lhotari merged commit ee7dc68 into apache:master May 1, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants