use of com.thoughtworks.go.server.perf.SchedulingPerformanceLogger in project gocd by gocd.
the class ScheduleServiceCachedIntegrationTest method shouldUpdateResultOfStageWhenJobCompletesOnTransactionCommitOnly.
@Test
public void shouldUpdateResultOfStageWhenJobCompletesOnTransactionCommitOnly() throws Exception {
StageService stageService = mock(StageService.class);
StageDao stageDao = mock(StageDao.class);
SchedulingPerformanceLogger schedulingPerformanceLogger = mock(SchedulingPerformanceLogger.class);
ScheduleService service = new ScheduleService(goConfigService, pipelineService, stageService, schedulingChecker, pipelineScheduledTopic, pipelineDao, stageDao, stageOrderService, securityService, pipelineScheduleQueue, jobInstanceService, jobInstanceDao, agentAssignment, environmentConfigService, pipelineLockService, serverHealthService, transactionTemplate, agentService, synchronizationManager, null, null, null, null, schedulingPerformanceLogger, null);
Pipeline assigned = preCondition.createPipelineWithFirstStageAssigned();
Stage stage = assigned.findStage(preCondition.devStage);
when(stageService.stageById(stage.getId())).thenThrow(new RuntimeException("find fails"));
try {
service.updateJobStatus(stage.getFirstJob().getIdentifier(), JobState.Completed);
fail("should have failed because stage lookup bombed");
} catch (Exception e) {
//ignore
}
verify(stageDao, never()).clearCachedAllStages(stage.getIdentifier().getPipelineName(), stage.getIdentifier().getPipelineCounter(), stage.getName());
}
use of com.thoughtworks.go.server.perf.SchedulingPerformanceLogger in project gocd by gocd.
the class ScheduleServiceRescheduleHungJobsTest method setUp.
@Before
public void setUp() {
agentService = mock(AgentService.class);
jobInstanceService = mock(JobInstanceService.class);
consoleActivityMonitor = mock(ConsoleActivityMonitor.class);
SchedulingPerformanceLogger schedulingPerformanceLogger = mock(SchedulingPerformanceLogger.class);
scheduleService = new ScheduleService(null, null, null, null, null, null, null, null, null, null, jobInstanceService, null, null, null, null, null, null, agentService, null, null, consoleActivityMonitor, null, null, schedulingPerformanceLogger, null);
}
Aggregations