You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/10/29 03:45:11 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #1497: Fix TestRoutingTableProviderPeriodicRefresh.

jiajunwang commented on a change in pull request #1497:
URL: https://github.com/apache/helix/pull/1497#discussion_r513928840



##########
File path: helix-core/src/test/java/org/apache/helix/integration/spectator/TestRoutingTableProviderPeriodicRefresh.java
##########
@@ -203,34 +208,32 @@ synchronized int getRefreshCount() {
 
   @Test
   public void testPeriodicRefresh() throws InterruptedException {
-    // Wait so that initial refreshes finish (not triggered by periodic refresh timer)
-    Thread.sleep(1000L);
+    // Wait to ensure that the initial refreshes finish (not triggered by periodic refresh timer)
+    Thread.sleep(REFRESH_PERIOD_MS * 2);
 
     // Test short refresh
     int prevRefreshCount = _routingTableProvider.getRefreshCount();
-    // Wait for one timer duration
-    Thread.sleep(1000L);
-    // The timer should have gone off, incrementing the refresh count
-    Assert.assertEquals(_routingTableProvider.getRefreshCount(), prevRefreshCount + 1);

Review comment:
       I guess it is just because of some timing issues. When you set up a time window that equals the interval, you might have one or two refreshes happen.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org