You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/09/16 22:14:36 UTC
[PR] [fix][test] Avoid unsafe cleanup between shared-cluster tests [pulsar]
lhotari opened a new pull request, #26611:
URL: https://github.com/apache/pulsar/pull/26611
### Motivation
SharedPulsarCluster keeps broker resources and worker threads alive across test classes. FastThreadLocalCleanupListener removes Netty fast-thread-local state between classes, while MockitoCleanupListener reflects into live workers' thread-local maps and performs global inline-mock cleanup. These operations can interfere with resources still owned by the shared cluster.
Global mock cleanup also does not solve ownership: Mockito invocations on a long-lived worker can retain ongoing-stubbing state and its mock graph on that worker. Clearing mocks from a different thread does not remove those references. Tests should avoid invoking mocks on shared workers and explicitly release fixtures they own.
### Modifications
- Remove FastThreadLocalCleanupListener and MockitoCleanupListener from the default TestNG listeners and delete the listener implementations. Keep the cleaner utilities for explicitly scoped use.
- Replace shared-worker mocks in dispatcher, reconnection, I/O, TTL, entry-filter, and entry-release tests with real fixtures or small subclasses.
- Add package-private testing helpers for metadata parsing/release and the TTL fallback path, preserving production behavior. Exercise metadata success and failure paths with real entries and buffers.
- Add explicit cleanup for owned mocks and WebSocket annotation fixtures, restore the shared broker interceptor, and close real Netty channels and their event loop.
- Update the multi-topic close test to monitor the scheduled executor provider actually used for retries.
### Verifying this change
- Local `./gradlew spotlessCheck checkstyleMain checkstyleTest` and `./gradlew quickCheck` passed.
- 82 scoped cases across the 13 affected test classes passed with retries disabled: dispatcher permit accounting and read conflation, single-active and classic dispatchers, metadata entry release, reader TTL, subscription and broker stats, multi-topic close, producer reconnection, I/O failures, Netty futures, and WebSocket authorization.
- 12 scoped buildtools cases passed for the listener-removal change.
- [ ] Make sure that the change passes the CI checks.
### Does this pull request potentially affect one of the following parts:
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [fix][test] Avoid unsafe cleanup between shared-cluster tests [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat merged PR #26611:
URL: https://github.com/apache/pulsar/pull/26611
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org