| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…etCooldownSurvivesLeaderFailover registerConsumer fires an asynchronous consumer-change auto-scale evaluation. A manual evaluateAutoScaleForTest() issued while it is in flight is coalesced into it and returns immediately; the coalesced re-run can then swallow the next manual evaluation too, so the hot-segment split had not happened yet when the test asserted. Wait for the event-driven evaluation to finish before evaluating manually. Fixes apache#26552 Assisted-by: Claude Code (claude-opus-5-5)
| Back | FazBrowse Home | New Git URL |
Fixes #26552
Motivation
ScalableTopicControllerAutoScaleTest.testRebucketCooldownSurvivesLeaderFailover fails intermittently in CI (Broker Group 2), for example here:
java.lang.AssertionError: a hot-segment split must fire — the rollover is not a split expected [2] but found [1] at ScalableTopicControllerAutoScaleTest.testRebucketCooldownSurvivesLeaderFailover(ScalableTopicControllerAutoScaleTest.java:507)registerConsumer("c9") fires an asynchronous consumer-change auto-scale evaluation. When it is still in flight, evaluateAndAct coalesces the test's evaluateAutoScaleForTest() call into it. The call sets the re-evaluate flag and returns an already-completed future without evaluating. That has two consequences:
I reproduced this deterministically by delaying the namespace-policy read in the test's mocks by 200 ms. With the delay, the test fails every time with the CI assertion message.
Modifications
No production behavior changes.
Verifying this change
This change is already covered by existing tests, such as ScalableTopicControllerAutoScaleTest.testRebucketCooldownSurvivesLeaderFailover. Verified locally:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes