kamalcph commented on code in PR #15885:
URL: https://github.com/apache/kafka/pull/15885#discussion_r1595488671
##########
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManagerTest.java:
##########
@@ -176,17 +178,18 @@ private void waitUntilConsumerCatchesUp(TopicIdPartition
newLeaderTopicIdPartiti
}
// If both the leader and follower partitions are mapped to the
same metadata partition then it should have at least
- // 2 messages. That means, read offset should be >= 1 (including
duplicate messages if any).
+ // 2 messages. That means, read offset should be >=
targetLeaderMetadataPartitionOffset (including duplicate messages if any).
if (leaderMetadataPartition == followerMetadataPartition) {
- if
(topicBasedRlmm().readOffsetForPartition(leaderMetadataPartition).orElse(-1L)
>= 1) {
+ Assertions.assertEquals(targetLeaderMetadataPartitionOffset,
targetFollowerMetadataPartitionOffset);
+ if
(topicBasedRlmm().readOffsetForPartition(leaderMetadataPartition).orElse(-1L)
>= targetLeaderMetadataPartitionOffset) {
Review Comment:
previously, we were waiting for `>=1`, after this change, `>=0`. This will
make the test more flaky.
when the leader and follower partitions are mapped to the same partition,
then we have to wait for twice the amount of messages.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]