[improve][test] Reduce overlapping TestNG fixtures - #26562
Open
lhotari wants to merge 1 commit into
Open
Conversation
Preserve class order and group factory instances so test fixtures can finish and release resources promptly within each worker. Assisted-by: Codex
lhotari
requested review from
Technoboy-,
dao-jun,
david-streamlio,
merlimat and
nodece
September 12, 2026 20:28
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
TestNG's default API ordering can interleave methods from different classes. Class-scoped broker fixtures then remain live together until their respective last methods finish, adding avoidable memory pressure within a test worker.
Modifications
Preserve class order and group factory-created instances in the shared TestNG configuration. This lets class and instance fixtures finish before the next group starts. Both options are needed because class ordering alone can interleave different instances of a factory-created test class. Gradle's test-fork parallelism and heap limits are unchanged.
Related fixture-isolation cleanup: #26563.
Verifying this change
Make sure that the change passes the CI checks.
assemble spotlessCheck checkstyleMain checkstyleTestpassed.All seven
LoadBalancerTesttests and four invocations of the selectedKeySharedSubscriptionTestmethods passed with retries disabled.Standalone lifecycle probes using TestNG 7.12.0 passed: the two-class probe reduced peak active fixtures from two to one; the factory probe retained one active fixture with both settings enabled. Each probe covered all of its four or six methods, respectively.
helpand the selected tests ran successfully with configuration caching enabled.Independent local review found no remaining issues.
Does this pull request potentially affect one of the following parts: