use of com.hubspot.singularity.SingularityRequestBuilder in project Singularity by HubSpot.
the class SingularityStartupTest method testOnDemandDoesntGetRescheduled.
@Test
public void testOnDemandDoesntGetRescheduled() {
saveRequest(new SingularityRequestBuilder(requestId, RequestType.ON_DEMAND).build());
deploy(firstDeployId);
deployChecker.checkDeploys();
Assert.assertTrue(requestManager.getPendingRequests().isEmpty());
Assert.assertTrue(taskManager.getPendingTaskIds().isEmpty());
startup.checkSchedulerForInconsistentState();
Assert.assertTrue(requestManager.getPendingRequests().isEmpty());
Assert.assertTrue(taskManager.getPendingTaskIds().isEmpty());
requestManager.addToPendingQueue(new SingularityPendingRequest(requestId, firstDeployId, System.currentTimeMillis(), Optional.<String>absent(), PendingType.ONEOFF, Optional.<Boolean>absent(), Optional.<String>absent()));
startup.checkSchedulerForInconsistentState();
Assert.assertTrue(requestManager.getPendingRequests().get(0).getPendingType() == PendingType.ONEOFF);
}
use of com.hubspot.singularity.SingularityRequestBuilder in project Singularity by HubSpot.
the class SingularitySchedulerTestBase method startAndDeploySecondRequest.
protected SingularityRequest startAndDeploySecondRequest() {
SingularityRequest request = new SingularityRequestBuilder(requestId + "2", RequestType.SERVICE).build();
saveRequest(request);
SingularityDeploy deploy = new SingularityDeployBuilder(request.getId(), "d1").setCommand(Optional.of("sleep 1")).build();
deployResource.deploy(new SingularityDeployRequest(deploy, Optional.absent(), Optional.absent()), singularityUser);
return request;
}
Aggregations