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

   ## Changes
   This PR improves the stability of the 
PlaintextAdminIntegrationTest.testElectPreferredLeaders test by introducing 
short Thread.sleep(...) delays before invoking:
   
   - changePreferredLeader(...)
   
   - waitForBrokersOutOfIsr(...)
   
   ## Reasons
   
   - Metadata propagation for partition2
   Kafka requires time to propagate the updated leader metadata across all 
brokers. Without waiting,  metadataCache may return outdated leader information 
for partition2.
   
   - Eviction of broker1 from the ISR
   To simulate a scenario where broker1 is no longer eligible as leader, the 
test relies on broker1 being removed from the ISR (e.g., due to intentional 
shutdown). This eviction is not instantaneous and requires a brief delay before 
Kafka reflects the change.


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to