SlotSharingGroup sharingGroup = new SlotSharingGroup();
sender.setSlotSharingGroup(sharingGroup);
receiver.setSlotSharingGroup(sharingGroup);
final JobGraph jobGraph = new JobGraph("Pointwise Job", sender, receiver);
jobGraph.setNumberOfExecutionRetries(1);
// make sure we have fast heartbeats and failure detection
Configuration cfg = new Configuration();
cfg.setInteger(ConfigConstants.JOB_MANAGER_DEAD_TASKMANAGER_TIMEOUT_KEY, 3000);
cfg.setInteger(ConfigConstants.TASK_MANAGER_HEARTBEAT_INTERVAL_KEY, 1000);
jm = startJobManager(2, NUM_TASKS, cfg);
JobSubmissionResult result = jm.submitJob(jobGraph);
if (result.getReturnCode() != AbstractJobResult.ReturnCode.SUCCESS) {
System.out.println(result.getDescription());
}
assertEquals(AbstractJobResult.ReturnCode.SUCCESS, result.getReturnCode());
// monitor the execution
ExecutionGraph eg = jm.getCurrentJobs().get(jobGraph.getJobID());
// wait for a bit until all is running, make sure the second attempt does not block
Thread.sleep(300);
ReceiverBlockingOnce.setShouldNotBlock();