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 2019/10/04 18:05:56 UTC
[GitHub] [incubator-pinot] jackjlli commented on a change in pull request
#4678: Use guava cache for instance admin endpoints
jackjlli commented on a change in pull request #4678: Use guava cache for instance admin endpoints
URL: https://github.com/apache/incubator-pinot/pull/4678#discussion_r331622415
##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManagerTest.java
##########
@@ -173,24 +172,18 @@ private void addAndRemoveNewInstanceConfig(ZkClient zkClient)
ZNRecord znRecord = new ZNRecord(instanceName);
zkClient.createPersistent(instanceConfigPath, znRecord);
- List<String> latestAllInstances = _helixResourceManager.getAllInstances();
- long maxTime = System.currentTimeMillis() + MAX_TIMEOUT_IN_MILLISECOND;
- while (!latestAllInstances.contains(instanceName) && System.currentTimeMillis() < maxTime) {
- Thread.sleep(100L);
- latestAllInstances = _helixResourceManager.getAllInstances();
- }
- Assert.assertTrue(System.currentTimeMillis() < maxTime, "Timeout when waiting for adding instance config");
+ TestUtils.waitForCondition(aVoid -> {
Review comment:
It's possible that direct data accessor still fails to get the instance config because of some other issues like zk connection. Let's still keep the wait for condition here.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org