use of org.apache.heron.packing.roundrobin.RoundRobinPacking in project heron by twitter.
the class HeronMasterDriverTest method onNextAllocatedEvaluatorStartsWorker.
@Test
public void onNextAllocatedEvaluatorStartsWorker() throws Exception {
PackingPlan packingPlan = PackingTestUtils.testPackingPlan("test", new RoundRobinPacking());
spyDriver.scheduleHeronWorkers(packingPlan);
assertTrue(spyDriver.lookupByContainerPlan(1).isPresent());
PackingPlan.ContainerPlan containerPlan = spyDriver.lookupByContainerPlan(1).get();
AllocatedEvaluator mockEvaluator = createMockEvaluator("test", getCpu(containerPlan), getRam(containerPlan));
assertFalse(spyDriver.lookupByEvaluatorId("test").isPresent());
spyDriver.new ContainerAllocationHandler().onNext(mockEvaluator);
assertTrue(spyDriver.lookupByEvaluatorId("test").isPresent());
assertEquals(Integer.valueOf(1), spyDriver.lookupByEvaluatorId("test").get());
verify(mockEvaluator, times(1)).submitContext(any(Configuration.class));
}
Aggregations