Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4353#discussion_r133022095
  
    --- Diff: 
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinatorTest.java
 ---
    @@ -553,31 +551,29 @@ public void testTriggerAndConfirmSimpleCheckpoint() {
                        assertFalse(checkpoint.isDiscarded());
                        assertFalse(checkpoint.isFullyAcknowledged());
     
    -                   OperatorID opID1 = 
OperatorID.fromJobVertexID(vertex1.getJobvertexId());
    -                   OperatorID opID2 = 
OperatorID.fromJobVertexID(vertex2.getJobvertexId());
    -
    -                   Map<OperatorID, OperatorState> operatorStates = 
checkpoint.getOperatorStates();
    -
    -                   operatorStates.put(opID1, new SpyInjectingOperatorState(
    -                           opID1, 
vertex1.getTotalNumberOfParallelSubtasks(), vertex1.getMaxParallelism()));
    -                   operatorStates.put(opID2, new SpyInjectingOperatorState(
    -                           opID2, 
vertex2.getTotalNumberOfParallelSubtasks(), vertex2.getMaxParallelism()));
    -
                        // check that the vertices received the trigger 
checkpoint message
                        {
                                verify(vertex1.getCurrentExecutionAttempt(), 
times(1)).triggerCheckpoint(eq(checkpointId), eq(timestamp), 
any(CheckpointOptions.class));
                                verify(vertex2.getCurrentExecutionAttempt(), 
times(1)).triggerCheckpoint(eq(checkpointId), eq(timestamp), 
any(CheckpointOptions.class));
                        }
     
    +                   OperatorID opID1 = 
OperatorID.fromJobVertexID(vertex1.getJobvertexId());
    +                   OperatorID opID2 = 
OperatorID.fromJobVertexID(vertex2.getJobvertexId());
    +                   TaskStateSnapshot taskOperatorSubtaskStates1 = 
mock(TaskStateSnapshot.class);
    --- End diff --
    
    Why not create a proper `TaskStateSnapshot` with one entry, rather than 
mocking?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to