|
@@ -148,10 +148,15 @@ public class TestMRJobs {
|
|
|
job.addFileToClassPath(APP_JAR); // The AppMaster jar itself.
|
|
|
job.setJarByClass(SleepJob.class);
|
|
|
job.setMaxMapAttempts(1); // speed up failures
|
|
|
- job.waitForCompletion(true);
|
|
|
+ job.submit();
|
|
|
+ String trackingUrl = job.getTrackingURL();
|
|
|
+ String jobId = job.getJobID().toString();
|
|
|
boolean succeeded = job.waitForCompletion(true);
|
|
|
Assert.assertTrue(succeeded);
|
|
|
Assert.assertEquals(JobStatus.State.SUCCEEDED, job.getJobState());
|
|
|
+ Assert.assertTrue("Tracking URL was " + trackingUrl +
|
|
|
+ " but didn't Match Job ID " + jobId ,
|
|
|
+ trackingUrl.endsWith(jobId.substring(jobId.lastIndexOf("_")) + "/"));
|
|
|
verifySleepJobCounters(job);
|
|
|
verifyTaskProgress(job);
|
|
|
|
|
@@ -209,9 +214,15 @@ public class TestMRJobs {
|
|
|
job.addFileToClassPath(APP_JAR); // The AppMaster jar itself.
|
|
|
job.setJarByClass(RandomTextWriterJob.class);
|
|
|
job.setMaxMapAttempts(1); // speed up failures
|
|
|
+ job.submit();
|
|
|
+ String trackingUrl = job.getTrackingURL();
|
|
|
+ String jobId = job.getJobID().toString();
|
|
|
boolean succeeded = job.waitForCompletion(true);
|
|
|
Assert.assertTrue(succeeded);
|
|
|
Assert.assertEquals(JobStatus.State.SUCCEEDED, job.getJobState());
|
|
|
+ Assert.assertTrue("Tracking URL was " + trackingUrl +
|
|
|
+ " but didn't Match Job ID " + jobId ,
|
|
|
+ trackingUrl.endsWith(jobId.substring(jobId.lastIndexOf("_")) + "/"));
|
|
|
|
|
|
// Make sure there are three files in the output-dir
|
|
|
|
|
@@ -316,9 +327,14 @@ public class TestMRJobs {
|
|
|
new Path(mrCluster.getTestWorkDir().getAbsolutePath(),
|
|
|
"failmapper-output"));
|
|
|
job.addFileToClassPath(APP_JAR); // The AppMaster jar itself.
|
|
|
+ job.submit();
|
|
|
+ String trackingUrl = job.getTrackingURL();
|
|
|
+ String jobId = job.getJobID().toString();
|
|
|
boolean succeeded = job.waitForCompletion(true);
|
|
|
Assert.assertFalse(succeeded);
|
|
|
-
|
|
|
+ Assert.assertTrue("Tracking URL was " + trackingUrl +
|
|
|
+ " but didn't Match Job ID " + jobId ,
|
|
|
+ trackingUrl.endsWith(jobId.substring(jobId.lastIndexOf("_")) + "/"));
|
|
|
return job;
|
|
|
}
|
|
|
|
|
@@ -360,8 +376,14 @@ public class TestMRJobs {
|
|
|
// //Job with reduces
|
|
|
// Job job = sleepJob.createJob(3, 2, 10000, 1, 10000, 1);
|
|
|
job.addFileToClassPath(APP_JAR); // The AppMaster jar itself.
|
|
|
+ job.submit();
|
|
|
+ String trackingUrl = job.getTrackingURL();
|
|
|
+ String jobId = job.getJobID().toString();
|
|
|
job.waitForCompletion(true);
|
|
|
Assert.assertEquals(JobStatus.State.SUCCEEDED, job.getJobState());
|
|
|
+ Assert.assertTrue("Tracking URL was " + trackingUrl +
|
|
|
+ " but didn't Match Job ID " + jobId ,
|
|
|
+ trackingUrl.endsWith(jobId.substring(jobId.lastIndexOf("_")) + "/"));
|
|
|
return null;
|
|
|
}
|
|
|
});
|
|
@@ -444,7 +466,12 @@ public class TestMRJobs {
|
|
|
job.setMaxMapAttempts(1); // speed up failures
|
|
|
|
|
|
job.submit();
|
|
|
+ String trackingUrl = job.getTrackingURL();
|
|
|
+ String jobId = job.getJobID().toString();
|
|
|
Assert.assertTrue(job.waitForCompletion(false));
|
|
|
+ Assert.assertTrue("Tracking URL was " + trackingUrl +
|
|
|
+ " but didn't Match Job ID " + jobId ,
|
|
|
+ trackingUrl.endsWith(jobId.substring(jobId.lastIndexOf("_")) + "/"));
|
|
|
}
|
|
|
|
|
|
private Path createTempFile(String filename, String contents)
|