[fix][test] Isolate mutable broker fixtures between test methods - #26563
Open
lhotari wants to merge 1 commit into
Open
[fix][test] Isolate mutable broker fixtures between test methods#26563lhotari wants to merge 1 commit into
lhotari wants to merge 1 commit into
Conversation
Reset dispatch-rate and auto-topic-creation fixtures per method, and restore the shared broker after the TLS client-configuration test to prevent order-dependent failures.
11 tasks
lhotari
requested review from
Technoboy-,
dao-jun,
david-streamlio,
merlimat and
nodece
September 12, 2026 21:24
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
Several broker tests share mutable configuration and topic metadata across methods. A dispatch-metrics test leaves rate limits enabled before another method expects unlimited permits. Auto-topic-creation tests retain topics, partitioned-topic metadata, and configuration even though later methods assert exact namespace counts and default behavior. The TLS client-configuration test also leaves the shared broker configured differently for the next method. These leaks cause order-dependent failures when the methods run together.
Modifications
BrokerDispatchRateLimiterTestandBrokerServiceAutoTopicCreationTesta fresh broker fixture for each method.BrokerServiceTest's fixture in afinallyblock after the TLS client-configuration test, and close its local client with try-with-resources.Existing assertions, asynchronous waits, and timeouts are preserved.
Verifying this change
This change is covered by both complete
BrokerDispatchRateLimiterTestandBrokerServiceAutoTopicCreationTestclasses, plusBrokerServiceTest.testTlsWithAuthParamsandtestTopicFailureShouldNotHaveDeadLock.invocationCount=10: 84 test invocations passed, with retries disabled and no skipped tests../gradlew spotlessCheck checkstyleMain checkstyleTestpassed across all modules.Both test runs used one test fork and TestNG
preserveOrder=true/groupByInstances=true. Local review confirmed that assertions and existing waits remain intact.Does this pull request potentially affect one of the following parts: