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/11/03 13:50:38 UTC

[GitHub] [helix] kaisun2000 commented on a change in pull request #1492: fix TestCleanupExternalView.test

kaisun2000 commented on a change in pull request #1492:
URL: https://github.com/apache/helix/pull/1492#discussion_r516197705



##########
File path: helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
##########
@@ -109,18 +109,14 @@ public void test() throws Exception {
     // System.out.println("re-enabling controller");
     admin.enableCluster(clusterName, true);
 
-    ExternalView externalView = null;
-    for (int i = 0; i < 10; i++) {
-      Thread.sleep(100);
-      externalView = accessor.getProperty(keyBuilder.externalView("TestDB0"));
-      // System.out.println("externalView: " + externalView);
-      if (externalView == null) {
-        break;
-      }
-    }
 
-    Assert.assertNull(externalView, "external-view for TestDB0 should be removed, but was: "
-        + externalView);
+    result = TestHelper.verify(() -> {
+      ExternalView externalView = accessor.getProperty(keyBuilder.externalView("TestDB0"));
+      return externalView == null;
+    }, TestHelper.WAIT_DURATION);
+
+    ExternalView ev = accessor.getProperty(keyBuilder.externalView("TestDB0"));

Review comment:
       This way does not work. Lambda varable captured (externalView here) needs to be final. Changed it to use instance variable then.

##########
File path: helix-core/src/test/java/org/apache/helix/integration/TestCleanupExternalView.java
##########
@@ -42,6 +42,7 @@
  * orphan external-view
  */
 public class TestCleanupExternalView extends ZkUnitTestBase {
+  private ExternalView _externalView = null;

Review comment:
       right. 
   just to make sure this is explicit, namely in normal path this is expected to be null all the time.




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