HDFS-5805. TestCheckpoint.testCheckpoint fails intermittently on branch-2. Contributed by Eric Badger.

This commit is contained in:
Kihwal Lee 2016-08-02 15:37:36 -05:00
parent 0458a2af6e
commit 5e5b8793fb

View File

@ -1030,6 +1030,7 @@ SecondaryNameNode startSecondaryNameNode(Configuration conf, int index)
*/ */
@Test @Test
public void testCheckpoint() throws IOException { public void testCheckpoint() throws IOException {
Path tmpDir = new Path("/tmp_tmp");
Path file1 = new Path("checkpoint.dat"); Path file1 = new Path("checkpoint.dat");
Path file2 = new Path("checkpoint2.dat"); Path file2 = new Path("checkpoint2.dat");
Configuration conf = new HdfsConfiguration(); Configuration conf = new HdfsConfiguration();
@ -1057,6 +1058,11 @@ public void testCheckpoint() throws IOException {
replication, seed); replication, seed);
checkFile(fileSys, file1, replication); checkFile(fileSys, file1, replication);
for(int i=0; i < 1000; i++) {
fileSys.mkdirs(tmpDir);
fileSys.delete(tmpDir, true);
}
// //
// Take a checkpoint // Take a checkpoint
// //
@ -1081,7 +1087,6 @@ public void testCheckpoint() throws IOException {
// //
// Restart cluster and verify that file1 still exist. // Restart cluster and verify that file1 still exist.
// //
Path tmpDir = new Path("/tmp_tmp");
try { try {
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes) cluster = new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes)
.format(false).build(); .format(false).build();