@Test
@DirtiesContext
public void simpleBackfillPreemptionTest() throws Exception {
Manager rm = this.locator.getManager();
Caller superuser = this.populator().getSuperuserCaller();
logger.debug("Submitting backfill requests..");
AsyncCreateRequest backfill1 = this.populator().getBackfillRequest("backfill1", 3);
RequestInfo backfill1Result = rm.addBackfillRequest(backfill1, superuser);
AsyncCreateRequest backfill2 = this.populator().getBackfillRequest("backfill2", 5);
RequestInfo backfill2Result = rm.addBackfillRequest(backfill2, superuser);
logger.debug("Waiting 2 seconds for resources to be allocated.");
Thread.sleep(2000);
// Check backfill request state
RequestInfo[] backfillRequestsByCaller = rm.getBackfillRequestsByCaller(superuser);
assertEquals(2, backfillRequestsByCaller.length);
logger.info(rm.getVMMReport());
// Three regular VMs should preempt
Caller caller = this.populator().getCaller();
CreateRequest req = this.populator().getCreateRequest("regular", 1200, 256 , 3);
rm.create(req, caller);
logger.debug("Waiting 2 seconds for resources to be allocated.");
Thread.sleep(2000);