MAPREDUCE-7108. TestFileOutputCommitter fails on Windows. (Zuoming Zhang via gera)

This commit is contained in:
Gera Shegalov 2018-06-12 11:21:51 -07:00
parent a16623df21
commit 04b74eddc6
1 changed files with 8 additions and 8 deletions

View File

@ -40,6 +40,7 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.RawLocalFileSystem; import org.apache.hadoop.fs.RawLocalFileSystem;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.MapFile; import org.apache.hadoop.io.MapFile;
import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.NullWritable;
@ -526,17 +527,16 @@ public class TestFileOutputCommitter {
// Ensure getReaders call works and also ignores // Ensure getReaders call works and also ignores
// hidden filenames (_ or . prefixes) // hidden filenames (_ or . prefixes)
MapFile.Reader[] readers = {};
try { try {
MapFileOutputFormat.getReaders(outDir, conf); readers = MapFileOutputFormat.getReaders(outDir, conf);
} catch (Exception e) {
fail("Fail to read from MapFileOutputFormat: " + e);
e.printStackTrace();
}
// validate output // validate output
validateMapFileOutputContent(FileSystem.get(job.getConfiguration()), outDir); validateMapFileOutputContent(FileSystem.get(job.getConfiguration()), outDir);
} finally {
IOUtils.cleanupWithLogger(null, readers);
FileUtil.fullyDelete(new File(outDir.toString())); FileUtil.fullyDelete(new File(outDir.toString()));
} }
}
@Test @Test
public void testMapFileOutputCommitterV1() throws Exception { public void testMapFileOutputCommitterV1() throws Exception {