suryakantade opened a new pull request, #22621:
URL: https://github.com/apache/kafka/pull/22621

   Summary
   
   Fixes the flaky testBalancePartitionLeaders test that was failing ~3% of CI 
runs.
   
    The root cause is a timing issue: the leader imbalance check interval (1s) 
combined with a 10× timeout multiplier left only a 10s window for the periodic 
electPreferred task to fire and rebalance partitions. Under CI 
thread-scheduling jitter (KafkaEventQueue uses real wall-clock 
cond.awaitNanos()), this was insufficient.
   
    Changes
   
    - Reduce leaderImbalanceCheckIntervalNs from 1s to 100ms — the periodic 
task fires more frequently, reducing sensitivity to thread-scheduling delays.
    - Increase the waitForCondition timeout multiplier from 10× to 100× (still 
10s total) — gives ample headroom for slow CI environments.
    - Add Javadoc explaining the test lifecycle and why the low check interval 
is necessary.
   
    Jira: KAFKA-19092 (https://issues.apache.org/jira/browse/KAFKA-19092)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to