@Test
public void testNotificationTimeout() throws InterruptedException {

  Configuration conf = new Configuration();
  // Reduce the timeout to 1 second
  conf.setInt("mapreduce.job.end-notification.timeout", 1000);
  JobStatus jobStatus = createTestJobStatus(
      "job_20130313155005308_0001", JobStatus.SUCCEEDED);
  JobConf jobConf = createTestJobConf(
      conf, 0,
      baseUrl + "delay");
  long startTime = System.currentTimeMillis();
  JobEndNotifier.localRunnerNotification(jobConf, jobStatus);
  long elapsedTime = System.currentTimeMillis() - startTime;
  // Validate params
  assertEquals(1, DelayServlet.calledTimes);
  // Make sure we timed out with time slightly above 1 second
  // (default timeout is in terms of minutes, so we'll catch the problem)
  assertTrue(elapsedTime < 2000);
}