Repository navigation
[improve][test] Reduce AuditorBookieTest wall time from 180s to 69s - #27094
Merged
merlimat merged 2 commits intoOct 30, 2026
Merged
Conversation
Close independent electors concurrently during Auditor test teardown, wait for shutdown tasks and worker-thread exit, and preserve cleanup failures and interruptions. Release fixture-owned resources and add deterministic cleanup regression tests. Assisted-by: Codex
codelipenghui
approved these changes
Oct 26, 2026
codelipenghui
left a comment
Contributor
There was a problem hiding this comment.
Reviewed commit 19a607304e9325846ed025f07c507e5309542b74. No actionable findings identified within the reviewed scope.
Validation caveat: all nine shutdown-helper tests passed. One integration test failed in the combined run but passed in isolation; full-suite and paired performance validation remain incomplete.
Denovo1998
approved these changes
Oct 30, 2026
dao-jun
approved these changes
Oct 30, 2026
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.
Motivation
This change reduces the five-test
AuditorBookieTestJVM wall time from 180 seconds to 69 seconds (61.7%) in a local paired run by closing independent electors concurrently during test teardown. It applies the same bounded cleanup to all three Auditor test classes while preserving their functional assertions and wait windows.The comparison used upstream master commit
1733139a1d1f, JDK 21, and BookKeeper 4.18.2:Teardown time fell by 94.5%, while test-body time stayed essentially unchanged. Previously, teardown closed independent electors sequentially; BookKeeper election/shutdown waits could therefore accumulate after the functional checks had completed. Concurrent shutdown overlaps these waits.
Both runs used the same runtime dependencies, resource-ownership fixes, CI listeners, leak settings, 1.3 GB heap, retries disabled, and four shared CPUs. The serial control changed only the teardown shutdown call back to the existing serial method. This is one pair of fresh-JVM local measurements; the complete CI critical-path reduction has not been measured.
Related upstream production fix: apache/bookkeeper#4914 addresses blocked follower election waits and shutdown completion in BookKeeper's
AuditorElector. This test teardown optimization is independent of that change; uninterruptible election waits in the Pulsar manager still require a separate Pulsar fix.Modifications
Only test sources change. BookKeeper dependencies, Pulsar manager code, and production lifecycle behavior are unchanged. Waiting for helper workers does not imply that every BookKeeper internal resource closes synchronously.
Verifying this change
Personal CI is still running on the fork PR: Pulsar CI and Pulsar CI Flaky. CI results are pending.
The following passed on the PR sources with JDK 21 and retries disabled: repository
quickCheck, all 33 tests in the three existing Auditor classes, and all nine new helper tests (42 tests, zero failures/skips).The separate serial/parallel timing runs each passed all five functional tests and had no unexpected surviving threads at the final strict resource check. The Gradle log also contained a
ChildWatchernull-path callback error. These results do not establish that the suite is free of flakes; the watcher is outside this change's scope.Does this pull request potentially affect one of the following parts: