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
1 changed files with 13 additions and 7 deletions

View File

@ -649,8 +649,9 @@ public class TestSequenceFile {
@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 class TestSequenceFile {
// Expected // Expected
} }
try {
createParent = true; createParent = true;
SequenceFile.createWriter(fs, conf, name, RandomDatum.class, SequenceFile.createWriter(fs, conf, name, RandomDatum.class,
RandomDatum.class, 512, (short) 1, 4096, createParent, RandomDatum.class, 512, (short) 1, 4096, createParent,
CompressionType.NONE, null, new Metadata()); CompressionType.NONE, null, new Metadata());
// should succeed, fails if exception thrown // should succeed, fails if exception thrown
} finally {
fs.deleteOnExit(parentDir);
fs.close();
}
} }
@Test @Test