This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4acdac697cb MINOR: Flaky test fixes (#21986)
4acdac697cb is described below

commit 4acdac697cb568a7a79b1cc04fb2f769815f025e
Author: Andrew Schofield <[email protected]>
AuthorDate: Tue Apr 14 06:42:13 2026 +0100

    MINOR: Flaky test fixes (#21986)
    
    Fixes a couple of flaky tests.
    
    Reviewers: Chia-Ping Tsai <[email protected]>, Apoorv Mittal
     <[email protected]>
---
 .../java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
 
b/tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
index 46942be75f3..a80a781158c 100644
--- 
a/tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
+++ 
b/tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java
@@ -88,9 +88,11 @@ public class LeaderElectionCommandErrorTest {
 
     @Test
     public void testInvalidBroker() {
+        // Use RFC 5737 TEST-NET-1 (192.0.2.0/24) - a non-routable address 
reserved for
+        // documentation and testing. This address guarantees a connection 
timeout.
         Throwable e = assertThrows(AdminCommandFailedException.class, () -> 
LeaderElectionCommand.run(
             Duration.ofSeconds(1),
-            "--bootstrap-server", "example.com:1234",
+            "--bootstrap-server", "192.0.2.1:9092",
             "--election-type", "unclean",
             "--all-topic-partitions"
         ));

Reply via email to