From 4c0bac56703bc7d58a3d572006fa3515428f7965 Mon Sep 17 00:00:00 2001 From: Amar Kamat Date: Wed, 4 Jan 2012 05:38:17 +0000 Subject: [PATCH] MAPREDUCE-3462. Fix Gridmix JUnit testcase failures. (Ravi Prakash and Ravi Gummadi via amarrk) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1227051 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../hadoop/mapred/gridmix/TestCompressionEmulationUtils.java | 2 ++ .../apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java | 1 + .../apache/hadoop/mapred/gridmix/TestGridmixSubmission.java | 1 + .../test/org/apache/hadoop/mapred/gridmix/TestSleepJob.java | 2 ++ 5 files changed, 9 insertions(+) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 3917acae289..5f75d6f0c08 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -52,6 +52,9 @@ Trunk (unreleased changes) MAPREDUCE-2944. Improve checking of input for JobClient.displayTasks() (XieXianshan via harsh) BUG FIXES + MAPREDUCE-3462. Fix Gridmix JUnit testcase failures. + (Ravi Prakash and Ravi Gummadi via amarrk) + MAPREDUCE-3349. Log rack-name in JobHistory for unsuccessful tasks. (Devaraj K and Amar Kamat via amarrk) diff --git a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestCompressionEmulationUtils.java b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestCompressionEmulationUtils.java index d1c1b9881db..51071a07a0a 100644 --- a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestCompressionEmulationUtils.java +++ b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestCompressionEmulationUtils.java @@ -105,6 +105,7 @@ public class TestCompressionEmulationUtils { conf.setInt(RandomTextDataGenerator.GRIDMIX_DATAGEN_RANDOMTEXT_WORDSIZE, wordSize); conf.setLong(GenerateData.GRIDMIX_GEN_BYTES, dataSize); + conf.set("mapreduce.job.hdfs-servers", ""); FileSystem lfs = FileSystem.getLocal(conf); @@ -192,6 +193,7 @@ public class TestCompressionEmulationUtils { CompressionEmulationUtil.setInputCompressionEmulationEnabled(conf, true); conf.setLong(GenerateData.GRIDMIX_GEN_BYTES, dataSize); + conf.set("mapreduce.job.hdfs-servers", ""); float expectedRatio = CompressionEmulationUtil.DEFAULT_COMPRESSION_RATIO; if (ratio > 0) { diff --git a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java index 163cc8073bf..0f1c7e2f712 100644 --- a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java +++ b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestDistCacheEmulation.java @@ -141,6 +141,7 @@ public class TestDistCacheEmulation { boolean useOldProperties) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); conf.set(MRJobConfig.USER_NAME, user); + conf.set("mapreduce.job.hdfs-servers", ""); // Set some dummy dist cache files in gridmix configuration so that they go // into the configuration of JobStory objects. String[] distCacheFiles = {"hdfs:///tmp/file1.txt", diff --git a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java index 2815f248e3d..802745522f2 100644 --- a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java +++ b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestGridmixSubmission.java @@ -521,6 +521,7 @@ public class TestGridmixSubmission { DebugGridmix client = new DebugGridmix(); conf = new Configuration(); conf.setEnum(GridmixJobSubmissionPolicy.JOB_SUBMISSION_POLICY,policy); + conf.set("mapreduce.job.hdfs-servers", ""); if (useDefaultQueue) { conf.setBoolean(GridmixJob.GRIDMIX_USE_QUEUE_IN_TRACE, false); conf.set(GridmixJob.GRIDMIX_DEFAULT_QUEUE, "q1"); diff --git a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestSleepJob.java b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestSleepJob.java index cf39710bd8b..84f292e770c 100644 --- a/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestSleepJob.java +++ b/hadoop-mapreduce-project/src/contrib/gridmix/src/test/org/apache/hadoop/mapred/gridmix/TestSleepJob.java @@ -205,6 +205,7 @@ public class TestSleepJob { throws Exception { Configuration conf = new Configuration(); conf.setBoolean(SleepJob.SLEEPJOB_MAPTASK_ONLY, true); + conf.set("mapreduce.job.hdfs-servers", ""); DebugJobProducer jobProducer = new DebugJobProducer(5, conf); JobConf jconf = GridmixTestUtils.mrCluster.createJobConf(new JobConf(conf)); UserGroupInformation ugi = UserGroupInformation.getLoginUser(); @@ -253,6 +254,7 @@ public class TestSleepJob { DebugGridmix client = new DebugGridmix(); conf = new Configuration(); conf.setEnum(GridmixJobSubmissionPolicy.JOB_SUBMISSION_POLICY, policy); + conf.set("mapreduce.job.hdfs-servers", ""); conf = GridmixTestUtils.mrCluster.createJobConf(new JobConf(conf)); // allow synthetic users to create home directories GridmixTestUtils.dfs.mkdirs(root, new FsPermission((short) 0777));