Repository navigation
[improve][test] Speed up HealthCheckTest by sharing cluster across test methods - #25448
Merged
merlimat merged 1 commit intoMar 31, 2026
Merged
Conversation
…st methods HealthCheckTest was starting and stopping an entire Docker-based PulsarCluster (ZK + BookKeeper + Broker) for each of its 3 test methods via @BeforeMethod/@AfterMethod, taking ~5 minutes total. Switch to @BeforeClass/@afterclass so the cluster is created once and shared across all tests. The destructive tests (testZooKeeperDown, testBookKeeperDown) now resume stopped processes with SIGCONT in finally blocks, keeping the cluster usable for subsequent tests. Also properly override TestRetrySupport's setup()/cleanup() methods and remove unused imports and dead code.
lhotari
approved these changes
Mar 31, 2026
1 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HealthCheckTestfrom@BeforeMethod/@AfterMethodto@BeforeClass/@AfterClassso the Docker-based PulsarCluster is started once instead of once per test methodSIGCONT(pkill -CONT) infinallyblocks for destructive tests (testZooKeeperDown,testBookKeeperDown) to resume stopped processes and keep the cluster usableTestRetrySupport.setup()/cleanup()and remove unused imports/dead codeThis reduces the test from ~5 minutes (3 full cluster start/stop cycles) to ~2 minutes (1 cycle).
Motivation
HealthCheckTestwas one of the slowest integration tests. Each of its 3 test methods was spinning up an entire PulsarCluster (ZooKeeper + BookKeeper + Broker containers) and tearing it down, even though the tests themselves are trivial healthcheck CLI calls.Documentation
doc-required(If you update the description, also update the determine of the documentation)
doc-not-needed(Please explain why)
doc(Your PR doesn't need any doc update)Matching PR in forked repository
PR in forked repository:
ready-to-testarea/test