rkhachatryan commented on a change in pull request #11491: [FLINK-16513][checkpointing] Unaligned checkpoints: checkpoint metadata URL: https://github.com/apache/flink/pull/11491#discussion_r400375877
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/LocalStateForwardingTest.java ########## @@ -232,7 +239,27 @@ public void storeLocalState( tmState.iterator().next()); } + private static <T extends StateObject> void performCollectionCheck( + Future<SnapshotResult<StateObjectCollection<T>>> resultFuture, + StateObjectCollection<T> jmState, + StateObjectCollection<T> tmState) { + + SnapshotResult<StateObjectCollection<T>> snapshotResult; + try { + snapshotResult = resultFuture.get(); + } catch (Exception e) { + throw new RuntimeException(e); + } + + Assert.assertEquals(snapshotResult.getJobManagerOwnedSnapshot(), jmState); + Assert.assertEquals(snapshotResult.getTaskLocalSnapshot(), tmState); + } + private static <T extends StateObject> RunnableFuture<SnapshotResult<T>> createSnapshotResult(Class<T> clazz) { return DoneFuture.of(SnapshotResult.withLocalState(mock(clazz), mock(clazz))); } + + private static <T extends StateObject> RunnableFuture<SnapshotResult<StateObjectCollection<T>>> createSnapshotCollectionResult(Class<T> clazz) { + return DoneFuture.of(SnapshotResult.withLocalState(singleton(mock(clazz)), singleton(mock(clazz)))); Review comment: I think it's better to either have all the fields of a class mocked or all not mocked, but not mixed. ---------------------------------------------------------------- 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 With regards, Apache Git Services