sarvekshayr commented on code in PR #9302:
URL: https://github.com/apache/ozone/pull/9302#discussion_r2532764925


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java:
##########
@@ -97,12 +98,17 @@ public void testContainerBalancerCLIOperations() throws 
Exception {
     running = containerBalancerClient.getContainerBalancerStatus();
     assertTrue(running);
 
-    // waiting for balance completed.
-    // TODO: this is a temporary implementation for now
-    // modify this after balancer is fully completed
-    try {
-      Thread.sleep(20000);
-    } catch (InterruptedException e) { }
+    GenericTestUtils.waitFor(
+        () -> {
+          try {
+            return !containerBalancerClient.getContainerBalancerStatus();
+          } catch (IOException e) {
+            return false;
+          }
+        },
+        100,
+        30000
+    );
 
     running = containerBalancerClient.getContainerBalancerStatus();
     assertFalse(running);

Review Comment:
   This check is redundant, `waitFor()` already covers this condition.
   ```suggestion
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to