Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/5579#discussion_r170854988 --- Diff: flink-queryable-state/flink-queryable-state-runtime/src/test/java/org/apache/flink/queryablestate/itcases/AbstractQueryableStateTestBase.java --- @@ -1307,24 +1268,13 @@ JobID getJobId() { public void close() throws Exception { // Free cluster resources if (jobId != null) { - cluster.getLeaderGateway(deadline.timeLeft()) - .ask(new JobManagerMessages.CancelJob(jobId), deadline.timeLeft()) - .mapTo(ClassTag$.MODULE$.<CancellationSuccess>apply(CancellationSuccess.class)); - - cancellationFuture.get(deadline.timeLeft().toMillis(), TimeUnit.MILLISECONDS); + clusterClient.cancel(jobId); + // cancel() is non-blocking so do this to make sure the job finished + clusterClient.requestJobResult(jobId).get(); --- End diff -- couldn't we query the job status instead?
---