ahuang98 commented on code in PR #16637: URL: https://github.com/apache/kafka/pull/16637#discussion_r1690548668
########## raft/src/test/java/org/apache/kafka/raft/RaftClientTestContext.java: ########## @@ -648,19 +648,41 @@ void assertSentDescribeQuorumResponse( long highWatermark, List<ReplicaState> voterStates, List<ReplicaState> observerStates + ) { + assertSentDescribeQuorumResponse(leaderId, leaderEpoch, highWatermark, voterStates, observerStates, Errors.NONE); + } + + void assertSentDescribeQuorumResponse( + int leaderId, + int leaderEpoch, + long highWatermark, + List<ReplicaState> voterStates, + List<ReplicaState> observerStates, + Errors error ) { DescribeQuorumResponseData response = collectDescribeQuorumResponse(); DescribeQuorumResponseData.PartitionData partitionData = new DescribeQuorumResponseData.PartitionData() - .setErrorCode(Errors.NONE.code()) + .setErrorCode(error.code()) Review Comment: Makes sense to have less duplicate code. I'll change it to use RaftUtil.singletonDescribeQuorumResponse. The small difference is assertSentDescribeQuorumResponse takes the voter and observer states as is while RaftUtil.singletonDescribeQuorumResponse will accept an additional `currentTimeMs` and overwrite the leader's `lastCaughtUp` and `lastFetch` timestamps with it -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org