use of org.apache.oozie.command.wf.KillXCommand in project oozie by apache.
the class TestSLAEventGeneration method _testWorkflowJobKillCommand.
private void _testWorkflowJobKillCommand(Configuration conf, SLAService slas) throws Exception {
cal.setTime(new Date());
// for start_miss
cal.add(Calendar.MINUTE, -20);
Date nominal = cal.getTime();
String nominalTime = DateUtils.formatDateOozieTZ(nominal);
conf.set("nominal_time", nominalTime);
// test that sla processes the Job Event from Kill command
// submit new job
String jobId = new SubmitXCommand(conf).call();
new KillXCommand(jobId).call();
// wait for wf-action kill event to generate
waitForEventGeneration(200);
ehs.new EventWorker().run();
// time for listeners to run
waitForEventGeneration(300);
SLACalcStatus slaEvent = skipToSLAEvent();
assertEquals(jobId, slaEvent.getId());
assertNotNull(slaEvent.getActualEnd());
assertEquals(EventStatus.END_MISS, slaEvent.getEventStatus());
assertEquals(SLAStatus.MISS, slaEvent.getSLAStatus());
assertEquals(WorkflowJob.Status.KILLED.name(), slaEvent.getJobStatus());
}
Aggregations