This is an automated email from the ASF dual-hosted git repository. chesnay pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push: new 8dfd811bea4 [FLINK-32479][tests] Wait until request was processed before revoking leadership 8dfd811bea4 is described below commit 8dfd811bea42fa1b35db79fba98c479779a09161 Author: Chesnay Schepler <ches...@apache.org> AuthorDate: Thu Jun 29 11:55:33 2023 +0200 [FLINK-32479][tests] Wait until request was processed before revoking leadership --- .../java/org/apache/flink/runtime/dispatcher/JobDispatcherITCase.java | 3 +++ .../runtime/leaderelection/LeaderChangeClusterComponentsTest.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/JobDispatcherITCase.java b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/JobDispatcherITCase.java index 908a0eca335..05bd86a53df 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/JobDispatcherITCase.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/JobDispatcherITCase.java @@ -127,6 +127,9 @@ public class JobDispatcherITCase { AtLeastOneCheckpointInvokable.atLeastOneCheckpointCompleted.await(); final CompletableFuture<JobResult> firstJobResult = cluster.requestJobResult(jobID); + // make sure requestJobResult was processed by job master + cluster.getJobStatus(jobID).get(); + haServices.revokeDispatcherLeadership(); // make sure the leadership is revoked to avoid race conditions Assertions.assertEquals( diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/LeaderChangeClusterComponentsTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/LeaderChangeClusterComponentsTest.java index 0285222c388..d8ddc11767d 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/LeaderChangeClusterComponentsTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/LeaderChangeClusterComponentsTest.java @@ -108,6 +108,8 @@ class LeaderChangeClusterComponentsTest { submissionFuture.get(); CompletableFuture<JobResult> jobResultFuture = miniCluster.requestJobResult(jobId); + // make sure requestJobResult was already processed by job master + miniCluster.getJobStatus(jobId).get(); highAvailabilityServices.revokeDispatcherLeadership().get();