Skip to content

Commit 4acdac6

Browse files
MINOR: Flaky test fixes (#21986)
Fixes a couple of flaky tests. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
1 parent 0d9fe51 commit 4acdac6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/src/test/java/org/apache/kafka/tools/LeaderElectionCommandErrorTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ public void testMissingTopicPartitionSelection() {
8888

8989
@Test
9090
public void testInvalidBroker() {
91+
// Use RFC 5737 TEST-NET-1 (192.0.2.0/24) - a non-routable address reserved for
92+
// documentation and testing. This address guarantees a connection timeout.
9193
Throwable e = assertThrows(AdminCommandFailedException.class, () -> LeaderElectionCommand.run(
9294
Duration.ofSeconds(1),
93-
"--bootstrap-server", "example.com:1234",
95+
"--bootstrap-server", "192.0.2.1:9092",
9496
"--election-type", "unclean",
9597
"--all-topic-partitions"
9698
));

0 commit comments

Comments
 (0)