Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/5239#discussion_r165309220 --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java --- @@ -3404,12 +3405,16 @@ public String fold(String acc, Integer value) throws Exception { } } - protected KeyedStateHandle runSnapshot(RunnableFuture<KeyedStateHandle> snapshotRunnableFuture) throws Exception { + protected KeyedStateHandle runSnapshot( + RunnableFuture<SnapshotResult<KeyedStateHandle>> snapshotRunnableFuture) throws Exception { + if(!snapshotRunnableFuture.isDone()) { Thread runner = new Thread(snapshotRunnableFuture); runner.start(); } - return snapshotRunnableFuture.get(); + + SnapshotResult<KeyedStateHandle> snapshotResult = snapshotRunnableFuture.get(); + return snapshotResult != null ? snapshotResult.getJobManagerOwnedSnapshot() : null; --- End diff -- By enforcing that `snapshotResult` is always not null, we could get rid of all these ternary statements.
---