From 4f1cdab6d8d90d44caa34733be41751029201479 Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Mon, 10 Oct 2011 03:10:45 +0000 Subject: [PATCH] MAPREDUCE-3153. Fix TestFileOutputCommitter which was broken by MAPREDUCE-2702. Contributed by Mahadev Konar. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1180769 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../mapreduce/lib/output/TestFileOutputCommitter.java | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1f878ecc51..bcc1c5ba84 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1549,6 +1549,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-2876. Use a different config for ContainerAllocationExpirer. (Anupam Seth via acmurthy) + MAPREDUCE-3153. Fix TestFileOutputCommitter which was broken by + MAPREDUCE-2702. (mahadev via acmurthy) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java index 65a0af6b46..60467acbf1 100644 --- a/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java +++ b/hadoop-mapreduce-project/src/test/mapred/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java @@ -37,6 +37,7 @@ import org.apache.hadoop.mapreduce.task.JobContextImpl; import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl; + public class TestFileOutputCommitter extends TestCase { private static Path outDir = new Path(System.getProperty("test.build.data", "/tmp"), "output"); @@ -187,9 +188,9 @@ public void testFailAbort() throws IOException, InterruptedException { assertNotNull(th); assertTrue(th instanceof IOException); assertTrue(th.getMessage().contains("fake delete failed")); - File jobTmpDir = new File(new Path(outDir, - FileOutputCommitter.TEMP_DIR_NAME).toString()); - File taskTmpDir = new File(jobTmpDir, "_" + taskID); + String filename = committer.getTaskAttemptBaseDirName(tContext); + File jobTmpDir = new File(outDir.toString(), committer.getJobAttemptBaseDirName(jContext)); + File taskTmpDir = new File(outDir.toString(), filename); File expectedFile = new File(taskTmpDir, partFile); assertTrue(expectedFile + " does not exists", expectedFile.exists());