diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java index 7c536e913b..092b5af2dd 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestMaintenanceState.java @@ -665,6 +665,8 @@ public void testMultipleNodesMaintenance() throws Exception { int repl = 3; writeFile(fileSys, file, repl, 1); + DFSTestUtil.waitForReplication((DistributedFileSystem) fileSys, file, + (short) repl, 10000); final DatanodeInfo[] nodes = getFirstBlockReplicasDatanodeInfos(fileSys, file);