Преглед изворни кода

HDFS-12112. TestBlockManager#testBlockManagerMachinesArray sometimes fails with NPE. Contributed by Wei-Chiu Chuang.

(cherry picked from commit b778887af59d96f1fac30cae14be1cabbdb74c8b)
Brahma Reddy Battula пре 7 година
родитељ
комит
6039a2a55f

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java

@@ -1149,7 +1149,7 @@ public class TestBlockManager {
     }
   }
 
-  @Test
+  @Test(timeout = 60000)
   public void testBlockManagerMachinesArray() throws Exception {
     final Configuration conf = new HdfsConfiguration();
     final MiniDFSCluster cluster =
@@ -1160,6 +1160,8 @@ public class TestBlockManager {
     final Path filePath = new Path("/tmp.txt");
     final long fileLen = 1L;
     DFSTestUtil.createFile(fs, filePath, fileLen, (short) 3, 1L);
+    DFSTestUtil.waitForReplication((DistributedFileSystem)fs,
+        filePath, (short) 3, 60000);
     ArrayList<DataNode> datanodes = cluster.getDataNodes();
     assertEquals(datanodes.size(), 4);
     FSNamesystem ns = cluster.getNamesystem();