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



##########
File path: helix-core/src/test/java/org/apache/helix/tools/TestClusterSetup.java
##########
@@ -73,44 +73,63 @@
   public void beforeClass() throws Exception {
     System.out
         .println("START TestClusterSetup.beforeClass() " + new 
Date(System.currentTimeMillis()));
+    _clusterSetup = new ClusterSetup(ZK_ADDR);
   }
 
   @AfterClass()
   public void afterClass() {
     deleteCluster(CLUSTER_NAME);
+    _clusterSetup.close();
     System.out.println("END TestClusterSetup.afterClass() " + new 
Date(System.currentTimeMillis()));
   }
 
   @BeforeMethod()
   public void setup() {
-
-    _gZkClient.deleteRecursively("/" + CLUSTER_NAME);
-    _clusterSetup = new ClusterSetup(ZK_ADDR);
-    _clusterSetup.addCluster(CLUSTER_NAME, true);
+    try {
+      _gZkClient.deleteRecursively("/" + CLUSTER_NAME);
+      _clusterSetup.addCluster(CLUSTER_NAME, true);
+    } catch (Exception e) {
+      System.out.println("@BeforeMethod TestClusterSetup exception:" + e);
+    }
   }
 
-  @Test
+  // Note, with mvn 3.6.1, we have a nasty bug that running "mvn test" under 
helix-core,
+  // all the bellow test will be invoked after other test including 
@AfterClass cleanup of this
+  // This bug does not happen of running command as "mvn test 
-Dtest=TestClusterSetup". Nor does it
+  // happen in intellij. The workaround found is to add dependsOnMethods 
attribute to all the rest.
+  @Test(dependsOnMethods = "testAddClusterWithValidCloudConfig")
   public void testZkAdminTimeout() {
     boolean exceptionThrown = false;
+    ZKHelixAdmin admin = null;

Review comment:
       added an test helper to reduce duplicated code.




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to