out.close();
scheduler.getPoolManager().reloadAllocs();
Pool poolA = scheduler.getPoolManager().getPool("poolA");
JobInProgress job1 = submitJob(JobStatus.RUNNING, 10, 10);
JobInfo info1 = scheduler.infos.get(job1);
// Check scheduler variables
assertEquals(0, info1.mapSchedulable.getRunningTasks());
assertEquals(0, info1.reduceSchedulable.getRunningTasks());
assertEquals(10, info1.mapSchedulable.getDemand());
assertEquals(10, info1.reduceSchedulable.getDemand());
assertEquals(4.0, info1.mapSchedulable.getFairShare());
assertEquals(4.0, info1.reduceSchedulable.getFairShare());
// Advance time 200ms and submit job 2
advanceTime(200);
JobInProgress job2 = submitJob(JobStatus.RUNNING, 10, 10, "poolA");
JobInfo info2 = scheduler.infos.get(job2);
// Check that minimum and fair shares have been allocated
assertEquals(2, poolA.getMapSchedulable().getMinShare());
assertEquals(2, poolA.getReduceSchedulable().getMinShare());
assertEquals(2.0, info1.mapSchedulable.getFairShare());
assertEquals(2.0, info1.reduceSchedulable.getFairShare());
assertEquals(2.0, info2.mapSchedulable.getFairShare());
assertEquals(2.0, info2.reduceSchedulable.getFairShare());
// Advance time 100ms and submit job 3
advanceTime(100);
JobInProgress job3 = submitJob(JobStatus.RUNNING, 10, 10, "poolA");
JobInfo info3 = scheduler.infos.get(job3);
// Check that minimum and fair shares have been allocated
assertEquals(2, poolA.getMapSchedulable().getMinShare());
assertEquals(2, poolA.getReduceSchedulable().getMinShare());
assertEquals(2.0, info1.mapSchedulable.getFairShare());