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

   This change is aimed at improving test logging and aiding in debugging.
   
   I noticed that `testElectPreferredLeaders()` has been flaky or has failed 
recently, 
[Develocity](https://ge.apache.org/scans/tests?search.names=CI%20workflow,Git%20repository&search.relativeStartTime=P90D&search.rootProjectNames=kafka&search.tags=github,trunk&search.tasks=test&search.timeZoneId=America%2FLos_Angeles&search.values=CI,https:%2F%2Fgithub.com%2Fapache%2Fkafka&tests.container=kafka.api.PlaintextAdminIntegrationTest&tests.test=testElectPreferredLeaders(String)%5B1%5D).
 
   
   Previously, the test made calls to the `preferredLeader()` method within 
both the lambda and the error message in the `TestUtils.waitUntilTrue` block. 
These repeated calls could potentially be misleading (or even inaccurate) when 
diagnosing test failures, as they might reflect different leader states.
   
   This update simplifies the test by storing the result of `preferredLeader()` 
in temporary variables, which are then consistently used in both the lambda and 
error message. This should make the test output clearer and more reliable for 
debugging.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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