You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "CalvinConfluent (via GitHub)" <gi...@apache.org> on 2025/02/16 17:00:53 UTC
[PR] MINOR: deflake EligibleLeaderReplicasIntegrationTest [kafka]
CalvinConfluent opened a new pull request, #18923:
URL: https://github.com/apache/kafka/pull/18923
(no comment)
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: deflake EligibleLeaderReplicasIntegrationTest [kafka]
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #18923:
URL: https://github.com/apache/kafka/pull/18923#discussion_r1962047980
##########
core/src/test/java/kafka/server/integration/EligibleLeaderReplicasIntegrationTest.java:
##########
@@ -417,11 +417,21 @@ public void testLastKnownLeaderShouldBeElectedIfEmptyElr(String quorum) throws E
waitForIsrAndElr((isrSize, elrSize) -> {
return isrSize > 0 && elrSize == 0;
});
- topicPartitionInfo = adminClient.describeTopics(Collections.singletonList(testTopicName))
- .allTopicNames().get().get(testTopicName).partitions().get(0);
- assertEquals(0, topicPartitionInfo.lastKnownElr().size());
- assertEquals(0, topicPartitionInfo.elr().size());
- assertEquals(lastKnownLeader, topicPartitionInfo.leader().id());
+
+ kafka.utils.TestUtils.waitUntilTrue(
+ () -> {
+ try {
+ TopicPartitionInfo partition = adminClient.describeTopics(Collections.singletonList(testTopicName))
+ .allTopicNames().get().get(testTopicName).partitions().get(0);
+ if (partition.leader() == null) return false;
+ return partition.lastKnownElr().isEmpty() && partition.elr().isEmpty() && partition.leader().id() == lastKnownLeader;
+ } catch (Exception e) {
+ return false;
+ }
+ },
+ () -> String.format("Partition metadata for %s is not correct", testTopicName),
+ org.apache.kafka.test.TestUtils.DEFAULT_MAX_WAIT_MS, 100L
Review Comment:
nit: Could we statically import `DEFAULT_MAX_WAIT_MS` and avoid the full qualified name?
##########
core/src/test/java/kafka/server/integration/EligibleLeaderReplicasIntegrationTest.java:
##########
@@ -417,11 +417,21 @@ public void testLastKnownLeaderShouldBeElectedIfEmptyElr(String quorum) throws E
waitForIsrAndElr((isrSize, elrSize) -> {
return isrSize > 0 && elrSize == 0;
});
- topicPartitionInfo = adminClient.describeTopics(Collections.singletonList(testTopicName))
- .allTopicNames().get().get(testTopicName).partitions().get(0);
- assertEquals(0, topicPartitionInfo.lastKnownElr().size());
- assertEquals(0, topicPartitionInfo.elr().size());
- assertEquals(lastKnownLeader, topicPartitionInfo.leader().id());
+
+ kafka.utils.TestUtils.waitUntilTrue(
Review Comment:
Is it possible to avoid `kafka.utils.`?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: deflake EligibleLeaderReplicasIntegrationTest [kafka]
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #18923:
URL: https://github.com/apache/kafka/pull/18923
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org