From 5e5b8793fba8e25aeba7a74878da4cf8e806f061 Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Tue, 2 Aug 2016 15:37:36 -0500 Subject: [PATCH] HDFS-5805. TestCheckpoint.testCheckpoint fails intermittently on branch-2. Contributed by Eric Badger. --- .../apache/hadoop/hdfs/server/namenode/TestCheckpoint.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java index 7c9df299e9c..e643d210057 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java @@ -1030,6 +1030,7 @@ public class TestCheckpoint { */ @Test public void testCheckpoint() throws IOException { + Path tmpDir = new Path("/tmp_tmp"); Path file1 = new Path("checkpoint.dat"); Path file2 = new Path("checkpoint2.dat"); Configuration conf = new HdfsConfiguration(); @@ -1057,6 +1058,11 @@ public class TestCheckpoint { replication, seed); checkFile(fileSys, file1, replication); + for(int i=0; i < 1000; i++) { + fileSys.mkdirs(tmpDir); + fileSys.delete(tmpDir, true); + } + // // Take a checkpoint // @@ -1081,7 +1087,6 @@ public class TestCheckpoint { // // Restart cluster and verify that file1 still exist. // - Path tmpDir = new Path("/tmp_tmp"); try { cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes) .format(false).build();