Skip to content

[fix][test] Fix flaky ExtensibleLoadManagerImpl client reconnection tests: PulsarClientException$AlreadyClosedException: Client already closed - #25509

Merged
merlimat merged 1 commit into
apache:masterfrom
void-ptr974:fix_flaky_elm_test
Apr 13, 2026
Merged

Conversation

@void-ptr974

Copy link
Copy Markdown
Contributor

The tests were failing intermittently with:
PulsarClientException$AlreadyClosedException: Client already closed : state = Closed

Root cause: 4 PulsarClient instances were shared across all test methods
via @BeforeClass. Once any client entered the Closed state (e.g. due to
a previous test timeout or incomplete cleanup of Mockito-spied lookup
services), all subsequent tests using that client would fail.

Fix: each test method now creates and closes its own PulsarClient
instances, eliminating shared mutable state between tests.

  The tests were failing intermittently with:
    PulsarClientException$AlreadyClosedException: Client already closed : state = Closed

  Root cause: 4 PulsarClient instances were shared across all test methods
  via @BeforeClass. Once any client entered the Closed state (e.g. due to
  a previous test timeout or incomplete cleanup of Mockito-spied lookup
  services), all subsequent tests using that client would fail.

  Fix: each test method now creates and closes its own PulsarClient
  instances, eliminating shared mutable state between tests.
@void-ptr974

Copy link
Copy Markdown
Contributor Author

@merlimat
merlimat merged commit bf45974 into apache:master Apr 13, 2026
43 checks passed
@void-ptr974
void-ptr974 deleted the fix_flaky_elm_test branch April 13, 2026 14:51
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…ests: PulsarClientException$AlreadyClosedException: Client already closed (#25509)

(cherry picked from commit bf45974)
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…ests: PulsarClientException$AlreadyClosedException: Client already closed (#25509)

(cherry picked from commit bf45974)
lhotari pushed a commit that referenced this pull request Apr 21, 2026
…ests: PulsarClientException$AlreadyClosedException: Client already closed (#25509)

(cherry picked from commit bf45974)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2026
…ests: PulsarClientException$AlreadyClosedException: Client already closed (apache#25509)

(cherry picked from commit bf45974)
(cherry picked from commit 3b92e85)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 27, 2026
…ests: PulsarClientException$AlreadyClosedException: Client already closed (apache#25509)

(cherry picked from commit bf45974)
@lhotari lhotari added this to the 5.0.0-M1 milestone Jun 12, 2026
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.

3 participants