Browse Source

HDFS-14137. TestMaintenanceState fails with ArrayIndexOutOfBound Exception. Contributed by Ayush Saxena.

Giovanni Matteo Fumarola 6 years ago
parent
commit
60af851e59

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

@@ -665,6 +665,8 @@ public class TestMaintenanceState extends AdminStatesBaseTest {
 
 
     int repl = 3;
     int repl = 3;
     writeFile(fileSys, file, repl, 1);
     writeFile(fileSys, file, repl, 1);
+    DFSTestUtil.waitForReplication((DistributedFileSystem) fileSys, file,
+        (short) repl, 10000);
     final DatanodeInfo[] nodes = getFirstBlockReplicasDatanodeInfos(fileSys,
     final DatanodeInfo[] nodes = getFirstBlockReplicasDatanodeInfos(fileSys,
         file);
         file);