chia7712 commented on code in PR #18900:
URL: https://github.com/apache/kafka/pull/18900#discussion_r1966689437
##########
core/src/test/scala/unit/kafka/server/AbstractFetcherThreadTest.scala:
##########
@@ -752,22 +752,22 @@ class AbstractFetcherThreadTest {
assertEquals(2L, replicaState.logEndOffset)
}
- @Test
- def testLeaderEpochChangeDuringFencedFetchEpochsFromLeader(): Unit = {
+ @ParameterizedTest
+ @ValueSource(ints = Array(0, 1))
+ def
testParameterizedLeaderEpochChangeDuringFetchEpochsFromLeader(leaderEpochOnLeader:
Int): Unit = {
+ // When leaderEpochOnLeader = 1:
// The leader is on the new epoch when the OffsetsForLeaderEpoch with old
epoch is sent, so it
// returns the fence error. Validate that response is ignored if the
leader epoch changes on
// the follower while OffsetsForLeaderEpoch request is in flight, but able
to truncate and fetch
// in the next of round of "doWork"
- testLeaderEpochChangeDuringFetchEpochsFromLeader(leaderEpochOnLeader = 1)
- }
- @Test
- def testLeaderEpochChangeDuringSuccessfulFetchEpochsFromLeader(): Unit = {
+ // When leaderEpochOnLeader = 0:
// The leader is on the old epoch when the OffsetsForLeaderEpoch with old
epoch is sent
// and returns the valid response. Validate that response is ignored if
the leader epoch changes
// on the follower while OffsetsForLeaderEpoch request is in flight, but
able to truncate and
// fetch once the leader is on the newer epoch (same as follower)
- testLeaderEpochChangeDuringFetchEpochsFromLeader(leaderEpochOnLeader = 0)
+
+ testLeaderEpochChangeDuringFetchEpochsFromLeader(leaderEpochOnLeader)
Review Comment:
could you please inline `testLeaderEpochChangeDuringFetchEpochsFromLeader`?
--
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]