mirror of
https://github.com/apache/kafka.git
synced 2026-11-04 04:44:54 +00:00
Add AdminClientTestUtils#currentLeader, which returns the current leader of a partition without waiting. Remove AdminUtils#fetchOrWaitForLeader and ClusterInstance#getLeaderBrokerId, and migrate all callers. Tests that need a specific leader now wrap it in TestUtils#waitForCondition, which also fixes the stale-leader race in LeaderElectionCommandTest. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>