Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/5062#discussion_r153804310 --- Diff: flink-queryable-state/flink-queryable-state-runtime/src/test/java/org/apache/flink/queryablestate/itcases/AbstractQueryableStateTestBase.java --- @@ -359,12 +355,12 @@ public Integer getKey(Tuple2<Integer, Long> value) throws Exception { } finally { // Free cluster resources if (jobId != null) { - scala.concurrent.Future<CancellationSuccess> cancellation = cluster - .getLeaderGateway(deadline.timeLeft()) + cluster.getLeaderGateway(deadline.timeLeft()) .ask(new JobManagerMessages.CancelJob(jobId), deadline.timeLeft()) - .mapTo(ClassTag$.MODULE$.<JobManagerMessages.CancellationSuccess>apply(JobManagerMessages.CancellationSuccess.class)); + .mapTo(ClassTag$.MODULE$.<CancellationSuccess>apply(CancellationSuccess.class)); - Await.ready(cancellation, deadline.timeLeft()); + // we are not waiting for the cancellation to happen because the + // job has actually failed, as tested above. --- End diff -- you can't guarantee this in the `finally` block. (for example if submitJobDetached failed but the job is actually running)
---