mxm commented on code in PR #12745:
URL: https://github.com/apache/iceberg/pull/12745#discussion_r2032614250


##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergCommitter.java:
##########
@@ -706,51 +706,6 @@ public void 
testRecoveryFromSnapshotWithoutCompletedNotification() throws Except
 
       SimpleDataUtil.assertTableRows(table, expectedRows, branch);
       assertSnapshotSize(1);
-
-      assertMaxCommittedCheckpointId(jobId, operatorId.toString(), 0);
-
-      RowData row = SimpleDataUtil.createRowData(2, "world");
-      expectedRows.add(row);
-      DataFile dataFile = writeDataFile("data-2", ImmutableList.of(row));
-      processElement(jobId, checkpointId, harness, 1, operatorId.toString(), 
dataFile);
-
-      snapshot = harness.snapshot(++checkpointId, ++timestamp);
-      assertFlinkManifests(0);
-    }
-
-    // Redeploying flink job from external checkpoint.
-    JobID newJobId = new JobID();
-    try (OneInputStreamOperatorTestHarness<
-            CommittableMessage<IcebergCommittable>, 
CommittableMessage<IcebergCommittable>>
-        harness = getTestHarness()) {
-      harness.getStreamConfig().setOperatorID(operatorId);
-      harness.initializeState(snapshot);

Review Comment:
   Here we need to call the following after initializing the state:
   
   ```java
   harness.notifyCheckpointComplete(checkpointId);
   ```
   
   This solves the issue with the test harness. Note that this doesn't sabotage 
the test setup because `notifyCheckpointComplete` is only guaranteed to be 
called zero or more times. It needs to be idempotent. So even if we called it 
multiple times, there shouldn't be any additional side effects.



##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergCommitter.java:
##########
@@ -706,51 +706,6 @@ public void 
testRecoveryFromSnapshotWithoutCompletedNotification() throws Except
 
       SimpleDataUtil.assertTableRows(table, expectedRows, branch);
       assertSnapshotSize(1);
-
-      assertMaxCommittedCheckpointId(jobId, operatorId.toString(), 0);
-
-      RowData row = SimpleDataUtil.createRowData(2, "world");
-      expectedRows.add(row);
-      DataFile dataFile = writeDataFile("data-2", ImmutableList.of(row));
-      processElement(jobId, checkpointId, harness, 1, operatorId.toString(), 
dataFile);
-
-      snapshot = harness.snapshot(++checkpointId, ++timestamp);
-      assertFlinkManifests(0);

Review Comment:
   This should be 
   
   ```java
         assertFlinkManifests(1);
   ```
   
   The previous assertion was simply wrong.



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to