MAPREDUCE-5610. TestSleepJob fails in jdk7. Contributed by Jonathan Eagles

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1541566 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-11-13 15:49:29 +00:00
parent e94ed91114
commit 744506f34d
3 changed files with 15 additions and 13 deletions

View File

@ -207,6 +207,8 @@ Release 2.3.0 - UNRELEASED
created by CombineFileInputFormat to fail (Robert Parker and Jason Lowe created by CombineFileInputFormat to fail (Robert Parker and Jason Lowe
via jlowe) via jlowe)
MAPREDUCE-5610. TestSleepJob fails in jdk7 (Jonathan Eagles via jlowe)
Release 2.2.1 - UNRELEASED Release 2.2.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -63,8 +63,8 @@ public GridmixJob createGridmixJob(
Configuration conf, long submissionMillis, JobStory jobdesc, Path outRoot, Configuration conf, long submissionMillis, JobStory jobdesc, Path outRoot,
UserGroupInformation ugi, int seq) throws IOException { UserGroupInformation ugi, int seq) throws IOException {
int numLocations = conf.getInt(SLEEPJOB_RANDOM_LOCATIONS, 0); int numLocations = conf.getInt(SLEEPJOB_RANDOM_LOCATIONS, 0);
if (numLocations < 0) numLocations=0; if (numLocations < 0) numLocations = 0;
if ((numLocations > 0) && (hosts == null)) { if (hosts == null) {
final JobClient client = new JobClient(new JobConf(conf)); final JobClient client = new JobClient(new JobConf(conf));
ClusterStatus stat = client.getClusterStatus(true); ClusterStatus stat = client.getClusterStatus(true);
final int nTrackers = stat.getTaskTrackers(); final int nTrackers = stat.getTaskTrackers();

View File

@ -58,17 +58,6 @@ public static void shutDown() throws IOException {
} }
/*
* test RandomLocation
*/
@Test
public void testRandomLocation() throws Exception {
UserGroupInformation ugi = UserGroupInformation.getLoginUser();
testRandomLocation(1, 10, ugi);
testRandomLocation(2, 10, ugi);
}
@Test @Test
public void testMapTasksOnlySleepJobs() throws Exception { public void testMapTasksOnlySleepJobs() throws Exception {
Configuration configuration = GridmixTestUtils.mrvl.getConfig(); Configuration configuration = GridmixTestUtils.mrvl.getConfig();
@ -90,6 +79,17 @@ public void testMapTasksOnlySleepJobs() throws Exception {
assertEquals(6, seq); assertEquals(6, seq);
} }
/*
* test RandomLocation
*/
@Test
public void testRandomLocation() throws Exception {
UserGroupInformation ugi = UserGroupInformation.getLoginUser();
testRandomLocation(1, 10, ugi);
testRandomLocation(2, 10, ugi);
}
// test Serial submit // test Serial submit
@Test @Test
public void testSerialSubmit() throws Exception { public void testSerialSubmit() throws Exception {