HADOOP-16967. TestSequenceFile#testRecursiveSeqFileCreate fails in subsequent run. Contributed by Ctest.

This commit is contained in:
Ayush Saxena 2020-04-12 11:31:07 +05:30
parent 275c478330
commit 2ea5adf2de

View File

@ -649,8 +649,9 @@ public void testCreateWriterOnExistingFile() throws IOException {
@Test @Test
public void testRecursiveSeqFileCreate() throws IOException { public void testRecursiveSeqFileCreate() throws IOException {
FileSystem fs = FileSystem.getLocal(conf); FileSystem fs = FileSystem.getLocal(conf);
Path name = new Path(new Path(GenericTestUtils.getTempPath( Path parentDir = new Path(GenericTestUtils.getTempPath(
"recursiveCreateDir")), "file"); "recursiveCreateDir"));
Path name = new Path(parentDir, "file");
boolean createParent = false; boolean createParent = false;
try { try {
@ -662,11 +663,16 @@ public void testRecursiveSeqFileCreate() throws IOException {
// Expected // Expected
} }
createParent = true; try {
SequenceFile.createWriter(fs, conf, name, RandomDatum.class, createParent = true;
RandomDatum.class, 512, (short) 1, 4096, createParent, SequenceFile.createWriter(fs, conf, name, RandomDatum.class,
CompressionType.NONE, null, new Metadata()); RandomDatum.class, 512, (short) 1, 4096, createParent,
// should succeed, fails if exception thrown CompressionType.NONE, null, new Metadata());
// should succeed, fails if exception thrown
} finally {
fs.deleteOnExit(parentDir);
fs.close();
}
} }
@Test @Test