This is an automated email from the ASF dual-hosted git repository.

trohrmann 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 72a6f3f  [FLINK-12006][tests] Wait for Curator background operation 
finished
72a6f3f is described below

commit 72a6f3f76040d9d594d184077ba7790fb8d6ec69
Author: tison <wander4...@gmail.com>
AuthorDate: Thu Mar 28 00:47:35 2019 +0800

    [FLINK-12006][tests] Wait for Curator background operation finished
    
    In order to wait for the NodeCache's background operation which generates 
the
    parent zNodes for the ZooKeeperLeaderRetrievalService, we wait for a new 
leader
    in the ZooKeeperHaServicesTest.
    
    This closes #8046.
---
 .../runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java
index 0edfdb9..b7bdd66 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java
@@ -191,11 +191,14 @@ public class ZooKeeperHaServicesTest extends TestLogger {
                        final LeaderElectionService 
resourceManagerLeaderElectionService = 
zooKeeperHaServices.getResourceManagerLeaderElectionService();
                        final RunningJobsRegistry runningJobsRegistry = 
zooKeeperHaServices.getRunningJobsRegistry();
 
-                       resourceManagerLeaderRetriever.start(new 
TestingListener());
+                       final TestingListener listener = new TestingListener();
+                       resourceManagerLeaderRetriever.start(listener);
                        resourceManagerLeaderElectionService.start(new 
TestingContender("foobar", resourceManagerLeaderElectionService));
                        final JobID jobId = new JobID();
                        runningJobsRegistry.setJobRunning(jobId);
 
+                       listener.waitForNewLeader(2000L);
+
                        resourceManagerLeaderRetriever.stop();
                        resourceManagerLeaderElectionService.stop();
                        runningJobsRegistry.clearJob(jobId);

Reply via email to