zentol commented on a change in pull request #9123: [FLINK-13281] Fix the
verify logic of
AdaptedRestartPipelinedRegionStrategyNGAbortPendingCheckpointsTest
URL: https://github.com/apache/flink/pull/9123#discussion_r303867334
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/AdaptedRestartPipelinedRegionStrategyNGAbortPendingCheckpointsTest.java
##########
@@ -76,49 +80,64 @@ public void abortPendingCheckpointsWhenRestartingTasks()
throws Exception {
final ExecutionGraph executionGraph =
createExecutionGraph(jobGraph);
final Iterator<ExecutionVertex> vertexIterator =
executionGraph.getAllExecutionVertices().iterator();
- final ExecutionVertex onlyExecutionVertex =
vertexIterator.next();
+ final ExecutionVertex firstExecutionVertex =
vertexIterator.next();
- setTaskRunning(executionGraph, onlyExecutionVertex);
+ setTaskRunning(executionGraph, firstExecutionVertex,
vertexIterator.next());
final CheckpointCoordinator checkpointCoordinator =
executionGraph.getCheckpointCoordinator();
checkState(checkpointCoordinator != null);
checkpointCoordinator.triggerCheckpoint(System.currentTimeMillis(), false);
final int pendingCheckpointsBeforeFailure =
checkpointCoordinator.getNumberOfPendingCheckpoints();
+ long checkpointId =
checkpointCoordinator.getPendingCheckpoints().keySet().iterator().next();
- failVertex(onlyExecutionVertex);
+ AcknowledgeCheckpoint acknowledgeCheckpoint = new
AcknowledgeCheckpoint(
+ firstExecutionVertex.getJobId(),
+
firstExecutionVertex.getCurrentExecutionAttempt().getAttemptId(),
+ checkpointId,
+ mock(CheckpointMetrics.class),
+ mock(TaskStateSnapshot.class));
+
+ // not let the first checkpoint to be discarded when
firstExecutionVertex has been acknowledged.
Review comment:
```suggestion
// let the first vertex acknowledge the checkpoint, and fail it
afterwards
// the failover strategy should then cancel all pending
checkpoints on restart
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services