NealSun96 commented on a change in pull request #844: Implement setRoutingData 
for MetadataStoreDirectoryService
URL: https://github.com/apache/helix/pull/844#discussion_r387202542
 
 

 ##########
 File path: 
helix-rest/src/test/java/org/apache/helix/rest/server/MetadataStoreDirectoryAccessorTestBase.java
 ##########
 @@ -100,23 +100,19 @@ public void beforeClass() throws Exception {
   @AfterClass
   public void afterClass() throws Exception {
     
System.clearProperty(MetadataStoreRoutingConstants.MSDS_SERVER_HOSTNAME_KEY);
+    _routingDataReader.close();
     deleteRoutingDataPath();
   }
 
-  protected void deleteRoutingDataPath() throws Exception {
-    Assert.assertTrue(TestHelper.verify(() -> {
-      _zkList.forEach(zk -> ZK_SERVER_MAP.get(zk).getZkClient()
-          .deleteRecursively(MetadataStoreRoutingConstants.ROUTING_DATA_PATH));
-
-      for (String zk : _zkList) {
-        if (ZK_SERVER_MAP.get(zk).getZkClient()
-            .exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) {
-          return false;
+  protected void deleteRoutingDataPath() {
+    for (String zk : _zkList) {
+      ZkClient zkClient = ZK_SERVER_MAP.get(zk).getZkClient();
+      if (zkClient.exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) {
+        for (String zkRealm : 
zkClient.getChildren(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) {
+          zkClient.delete(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + 
"/" + zkRealm);
 
 Review comment:
   Very good point. I'll try to add the same block to all similar clean ups. 

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


With regards,
Apache Git Services

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

Reply via email to