tillrohrmann commented on a change in pull request #8046:  [FLINK-12006][tests] 
Wait for Curator background operation finished
URL: https://github.com/apache/flink/pull/8046#discussion_r270339691
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/highavailability/zookeeper/ZooKeeperHaServicesTest.java
 ##########
 @@ -119,46 +119,54 @@ public void testSimpleClose() throws Exception {
         */
        @Test
        public void testSimpleCloseAndCleanupAllData() throws Exception {
-               final Configuration configuration = 
createConfiguration("/foo/bar/flink");
+               int repetitions = 100;
 
-               final TestingBlobStoreService blobStoreService = new 
TestingBlobStoreService();
+               for (int i = 0; i < repetitions; i++) {
+                       final Configuration configuration = 
createConfiguration("/foo/bar/flink");
 
-               final List<String> initialChildren = 
client.getChildren().forPath("/");
+                       final TestingBlobStoreService blobStoreService = new 
TestingBlobStoreService();
 
-               runCleanupTest(
-                       configuration,
-                       blobStoreService,
-                       ZooKeeperHaServices::closeAndCleanupAllData);
+                       final List<String> initialChildren = 
client.getChildren().forPath("/");
 
-               assertThat(blobStoreService.isClosedAndCleanedUpAllData(), 
is(true));
+                       runCleanupTest(
+                               configuration,
+                               blobStoreService,
+                               ZooKeeperHaServices::closeAndCleanupAllData);
 
-               final List<String> children = client.getChildren().forPath("/");
-               assertThat(children, is(equalTo(initialChildren)));
+                       
assertThat(blobStoreService.isClosedAndCleanedUpAllData(), is(true));
+
+                       final List<String> children = 
client.getChildren().forPath("/");
+                       assertThat(children, is(equalTo(initialChildren)));
+               }
        }
 
        /**
         * Tests that we can only delete the parent znodes as long as they are 
empty.
         */
        @Test
        public void testCloseAndCleanupAllDataWithUncle() throws Exception {
-               final String prefix = "/foo/bar";
-               final String flinkPath = prefix + "/flink";
-               final Configuration configuration = 
createConfiguration(flinkPath);
+               int repetitions = 100;
 
-               final TestingBlobStoreService blobStoreService = new 
TestingBlobStoreService();
+               for (int i = 0; i < repetitions; i++) {
 
 Review comment:
   Let's remove the looping before merging.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to