浏览代码

ZOOKEEPER-2032. Cleaning up resources in ReconfigBackupTest (Hongchao Deng via shralex)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1623916 13f79535-47bb-0310-9956-ffa450edef68
Alexander Shraer 11 年之前
父节点
当前提交
55d9130276
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 2 0
      CHANGES.txt
  2. 10 0
      src/java/test/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java

+ 2 - 0
CHANGES.txt

@@ -46,6 +46,8 @@ NEW FEATURES:
   (Skye Wanderman-Milne, Bill Havanki via phunt)
   (Skye Wanderman-Milne, Bill Havanki via phunt)
 
 
 BUGFIXES:
 BUGFIXES:
+  ZOOKEEPER-2032. Cleaning up resources in ReconfigBackupTest (Hongchao Deng via shralex)
+
   ZOOKEEPER-2013. Typos in programmer guide. (Tim Chambers via Alex Shraer)  
   ZOOKEEPER-2013. Typos in programmer guide. (Tim Chambers via Alex Shraer)  
 
 
   ZOOKEEPER-2006. Standalone mode won't take client port from dynamic config. (Hongchao Deng via Alex Shraer)  
   ZOOKEEPER-2006. Standalone mode won't take client port from dynamic config. (Hongchao Deng via Alex Shraer)  

+ 10 - 0
src/java/test/org/apache/zookeeper/server/quorum/ReconfigBackupTest.java

@@ -104,6 +104,10 @@ public class ReconfigBackupTest extends QuorumPeerTestBase {
             staticBackupContent[i] = getFileContent(backupFile);
             staticBackupContent[i] = getFileContent(backupFile);
             Assert.assertEquals(staticFileContent[i], staticBackupContent[i]);
             Assert.assertEquals(staticFileContent[i], staticBackupContent[i]);
         }
         }
+
+        for (int i = 0; i < SERVER_COUNT; i++) {
+            mt[i].shutdown();
+        }
     }
     }
 
 
     /**
     /**
@@ -334,6 +338,8 @@ public class ReconfigBackupTest extends QuorumPeerTestBase {
                 String otherDynamicFileContent = getFileContent(dynamicConfigFile);
                 String otherDynamicFileContent = getFileContent(dynamicConfigFile);
                 Assert.assertEquals(dynamicFileContent, otherDynamicFileContent);
                 Assert.assertEquals(dynamicFileContent, otherDynamicFileContent);
             }
             }
+
+            zk.close();
         }
         }
 
 
         // finally, we should also check that the lag-off server has updated
         // finally, we should also check that the lag-off server has updated
@@ -341,5 +347,9 @@ public class ReconfigBackupTest extends QuorumPeerTestBase {
         Assert.assertTrue(
         Assert.assertTrue(
                 mt[lagOffServerId].getPropFromStaticFile("dynamicConfigFile")
                 mt[lagOffServerId].getPropFromStaticFile("dynamicConfigFile")
                         .endsWith(".200000000"));
                         .endsWith(".200000000"));
+
+        for (int i = 0; i < SERVER_COUNT; i++) {
+            mt[i].shutdown();
+        }
     }
     }
 }
 }