guozhangwang commented on a change in pull request #8964:
URL: https://github.com/apache/kafka/pull/8964#discussion_r468796183



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamTaskTest.java
##########
@@ -1259,13 +1262,47 @@ public void shouldReInitializeTopologyWhenResuming() 
throws IOException {
     }
 
     @Test
-    public void shouldCheckpointOffsetsOnCommit() {
+    public void 
shouldNotCheckpointOffsetsAgainOnCommitIfSnapshotNotChangedMuch() {
         final Long offset = 543L;
 
         
EasyMock.expect(recordCollector.offsets()).andReturn(Collections.singletonMap(changelogPartition,
 offset)).anyTimes();
-        
stateManager.checkpoint(EasyMock.eq(Collections.singletonMap(changelogPartition,
 offset)));
+        stateManager.checkpoint();
+        EasyMock.expectLastCall().once();
+        
EasyMock.expect(stateManager.changelogPartitions()).andReturn(Collections.singleton(changelogPartition));
+        EasyMock.expect(stateManager.changelogOffsets())
+                .andReturn(Collections.singletonMap(changelogPartition, 0L))
+                .andReturn(Collections.singletonMap(changelogPartition, 10L))
+                .andReturn(Collections.singletonMap(changelogPartition, 20L));
+        stateManager.registerStore(stateStore, 
stateStore.stateRestoreCallback);
         EasyMock.expectLastCall();
+        EasyMock.replay(stateManager, recordCollector);
+
+        task = createStatefulTask(createConfig(false, "100"), true);
+
+        task.initializeIfNeeded();
+        task.completeRestoration();
+
+        task.prepareCommit();
+        task.postCommit(true);
+
+        task.prepareCommit();
+        task.postCommit(false);
+
+        EasyMock.verify(recordCollector);

Review comment:
       ack




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to