Преглед на файлове

HDFS-11411. Avoid OutOfMemoryError in TestMaintenanceState test runs. (Manoj Govindassamy via mingma)

Ming Ma преди 8 години
родител
ревизия
cfcd527323
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java

+ 6 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java

@@ -333,6 +333,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
   private void testExpectedReplication(int replicationFactor,
       int expectedReplicasInRead) throws IOException {
+    setup();
     startCluster(1, 5);
 
     final Path file = new Path("/testExpectedReplication.dat");
@@ -352,6 +353,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
         nodeOutofService));
 
     cleanupFile(fileSys, file);
+    teardown();
   }
 
   /**
@@ -492,6 +494,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
   private void testDecommissionDifferentNodeAfterMaintenance(int repl)
       throws Exception {
+    setup();
     startCluster(1, 5);
 
     final Path file =
@@ -519,6 +522,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
     assertNull(checkWithRetry(ns, fileSys, file, repl + 1, null));
 
     cleanupFile(fileSys, file);
+    teardown();
   }
 
   /**
@@ -583,6 +587,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
    */
   private void testChangeReplicationFactor(int oldFactor, int newFactor,
       int expectedLiveReplicas) throws IOException {
+    setup();
     LOG.info("Starting testChangeReplicationFactor {} {} {}",
         oldFactor, newFactor, expectedLiveReplicas);
     startCluster(1, 5);
@@ -615,6 +620,7 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
     assertNull(checkWithRetry(ns, fileSys, file, newFactor, null));
 
     cleanupFile(fileSys, file);
+    teardown();
   }