You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/05 23:12:58 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #8981: Fix a repeatable problem in PinotTaskManagerStatelessTest

walterddr commented on code in PR #8981:
URL: https://github.com/apache/pinot/pull/8981#discussion_r914275098


##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java:
##########
@@ -269,6 +280,38 @@ public void startController(Map<String, Object> properties)
     configAccessor.set(scope, Helix.DEFAULT_HYPERLOGLOG_LOG2M_KEY, Integer.toString(12));
   }
 
+  protected void waitForController()
+      throws InterruptedException, TimeoutException {
+    boolean ready = false;
+    Instant start = Instant.now();
+    Duration timeoutDuration = Duration.ofSeconds(60);
+    Instant timeoutInstant = Instant.now().plus(timeoutDuration);
+
+    _logger.info("Verifying that controller can be reached");
+    boolean failedAtLeastOnce = false;
+
+    while (!ready && Instant.now().isBefore(timeoutInstant)) {
+      try {
+        getControllerRequestClient().getSchema("whatever");

Review Comment:
   you can do health check basically ?



##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java:
##########
@@ -269,6 +280,38 @@ public void startController(Map<String, Object> properties)
     configAccessor.set(scope, Helix.DEFAULT_HYPERLOGLOG_LOG2M_KEY, Integer.toString(12));
   }
 
+  protected void waitForController()

Review Comment:
   there's a `TestUtils.waitForCondition` that does most of the time keeping similar to this one. can we reuse that?



##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java:
##########
@@ -128,6 +133,11 @@ public class ControllerTest {
   protected ZkHelixPropertyStore<ZNRecord> _propertyStore;
 
   private ZkStarter.ZookeeperInstance _zookeeperInstance;
+  private final Logger _logger;
+
+  public ControllerTest() {
+    _logger = LoggerFactory.getLogger(this.getClass());

Review Comment:
   this can be private static final right? 



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org