jolshan commented on code in PR #15155:
URL: https://github.com/apache/kafka/pull/15155#discussion_r1448140646
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/OffsetMetadataManagerTest.java:
##########
@@ -1963,6 +2080,75 @@ public void
testFetchAllOffsetsAtDifferentCommittedOffset() {
), context.fetchAllOffsets("group", Long.MAX_VALUE));
}
+ @Test
+ public void testFetchAllOffsetsWithPendingTransactionalOffsets() {
+ OffsetMetadataManagerTestContext context = new
OffsetMetadataManagerTestContext.Builder().build();
+
+ context.groupMetadataManager.getOrMaybeCreateConsumerGroup("group",
true);
+
+ context.commitOffset("group", "foo", 0, 100L, 1);
+ context.commitOffset("group", "foo", 1, 110L, 1);
+ context.commitOffset("group", "bar", 0, 200L, 1);
+
+ context.commit();
+
+ assertEquals(3, context.lastWrittenOffset);
+ assertEquals(3, context.lastCommittedOffset);
+
+ context.commitOffset(10L, "group", "foo", 1, 111L, 1,
context.time.milliseconds());
+ context.commitOffset(10L, "group", "bar", 0, 201L, 1,
context.time.milliseconds());
Review Comment:
should we have bar-1 again to test that case too?
--
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]