rkhachatryan commented on a change in pull request #14953:
URL: https://github.com/apache/flink/pull/14953#discussion_r579272357



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/StandaloneCompletedCheckpointStoreTest.java
##########
@@ -89,37 +82,6 @@ public void testSuspendDiscardsCheckpoints() throws 
Exception {
         verifyCheckpointDiscarded(taskStates);
     }
 
-    /**
-     * Tests that the checkpoint does not exist in the store when we fail to 
add it into the store
-     * (i.e., there exists an exception thrown by the method).
-     */
-    @Test
-    public void testAddCheckpointWithFailedRemove() throws Exception {
-
-        final int numCheckpointsToRetain = 1;
-        CompletedCheckpointStore store =
-                createCompletedCheckpoints(numCheckpointsToRetain, 
Executors.directExecutor());
-
-        for (long i = 0; i <= numCheckpointsToRetain; ++i) {
-            CompletedCheckpoint checkpointToAdd = 
mock(CompletedCheckpoint.class);
-            doReturn(i).when(checkpointToAdd).getCheckpointID();
-            
doReturn(Collections.emptyMap()).when(checkpointToAdd).getOperatorStates();
-            doThrow(new 
IOException()).when(checkpointToAdd).discardOnSubsume();
-
-            try {
-                store.addCheckpoint(checkpointToAdd, new CheckpointsCleaner(), 
() -> {});
-
-                // The checkpoint should be in the store if we successfully 
add it into the store.
-                List<CompletedCheckpoint> addedCheckpoints = 
store.getAllCheckpoints();
-                assertTrue(addedCheckpoints.contains(checkpointToAdd));
-            } catch (Exception e) {
-                // The checkpoint should not be in the store if any exception 
is thrown.
-                List<CompletedCheckpoint> addedCheckpoints = 
store.getAllCheckpoints();
-                assertFalse(addedCheckpoints.contains(checkpointToAdd));
-            }
-        }
-    }
-

Review comment:
       Thanks for pointing out, you're right.
   I'll remove the dead code and replace mocks with the normal objects.




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