Skip to content

Commit

Permalink
KAFKA-17988: Fix flaky ReconfigurableQuorumIntegrationTest.testRemove…
Browse files Browse the repository at this point in the history
…AndAddSameController (#17782)

Reviewers: David Arthur <[email protected]>
  • Loading branch information
kevin-wu24 authored Nov 14, 2024
1 parent b6b2c9e commit 4fcb8b2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.kafka.common.Uuid;
import org.apache.kafka.common.test.KafkaClusterTestKit;
import org.apache.kafka.common.test.TestKitNodes;
import org.apache.kafka.common.test.api.Flaky;
import org.apache.kafka.server.common.KRaftVersion;
import org.apache.kafka.test.TestUtils;

Expand Down Expand Up @@ -130,7 +129,6 @@ public void testRemoveController() throws Exception {
}
}

@Flaky("KAFKA-17988")
@Test
public void testRemoveAndAddSameController() throws Exception {
try (KafkaClusterTestKit cluster = new KafkaClusterTestKit.Builder(
Expand All @@ -152,6 +150,13 @@ public void testRemoveAndAddSameController() throws Exception {
});
Uuid dirId = cluster.nodes().controllerNodes().get(3000).metadataDirectoryId();
admin.removeRaftVoter(3000, dirId).all().get();
TestUtils.retryOnExceptionWithTimeout(30_000, 10, () -> {
Map<Integer, Uuid> voters = findVoterDirs(admin);
assertEquals(new HashSet<>(Arrays.asList(3001, 3002, 3003)), voters.keySet());
for (int replicaId : new int[] {3001, 3002, 3003}) {
assertNotEquals(Uuid.ZERO_UUID, voters.get(replicaId));
}
});
admin.addRaftVoter(
3000,
dirId,
Expand Down

0 comments on commit 4fcb8b2

Please sign in to comment.