@Test public void fetchFlowHistory() throws Exception { final ExecutableFlow flow = createTestFlow(); this.executionFlowDao.uploadExecutableFlow(flow); final List<ExecutableFlow> flowList1 = this.executionFlowDao.fetchFlowHistory(0, 2); assertThat(flowList1.size()).isEqualTo(1); final List<ExecutableFlow> flowList2 = this.executionFlowDao .fetchFlowHistory(flow.getProjectId(), flow.getId(), 0, 2); assertThat(flowList2.size()).isEqualTo(1); final ExecutableFlow fetchFlow = this.executionFlowDao.fetchExecutableFlow(flow.getExecutionId()); assertTwoFlowSame(flowList1.get(0), flowList2.get(0)); assertTwoFlowSame(flowList1.get(0), fetchFlow); }
@Test public void testSubmitFlowsExceedingMaxConcurrentRuns() throws Exception { submitFlow(this.flow2, this.ref2); submitFlow(this.flow3, this.ref3); assertThatThrownBy(() -> this.controller.submitExecutableFlow(this.flow4, this.user.getUserId ())).isInstanceOf(ExecutorManagerException.class).hasMessageContaining("Flow " + this .flow4.getId() + " has more than 1 concurrent runs. Skipping"); }
public String submitExecutableFlow(final ExecutableFlow exflow, final String userId) throws ExecutorManagerException { final String exFlowKey = exflow.getProjectName() + "." + exflow.getId() + ".submitFlow";
@Test public void testSubmitFlowsWithSkipOption() throws Exception { submitFlow(this.flow2, this.ref2); this.flow3.getExecutionOptions().setConcurrentOption(ExecutionOptions.CONCURRENT_OPTION_SKIP); assertThatThrownBy( () -> this.controller.submitExecutableFlow(this.flow3, this.user.getUserId())) .isInstanceOf(ExecutorManagerException.class).hasMessageContaining( "Flow " + this.flow3.getId() + " is already running. Skipping execution."); }
throws ExecutorManagerException { final String exFlowKey = exflow.getProjectName() + "." + exflow.getId() + ".submitFlow";
final String message = "Failed to dispatch queued execution " + exflow.getId() + " because " + "reached " + ConfigurationKeys.MAX_DISPATCHING_ERRORS_PERMITTED + " (tried " + reference.getNumErrors() + " executors)";
private ExecutableFlow getExecutableFlowMetadata( ExecutableFlow fullExFlow) { final Flow flow = new Flow(fullExFlow.getId()); final Project project = new Project(fullExFlow.getProjectId(), null); project.setVersion(fullExFlow.getVersion()); flow.setVersion(fullExFlow.getVersion()); final ExecutableFlow metadata = new ExecutableFlow(project, flow); metadata.setExecutionId(fullExFlow.getExecutionId()); metadata.setStatus(fullExFlow.getStatus()); metadata.setSubmitTime(fullExFlow.getSubmitTime()); metadata.setStartTime(fullExFlow.getStartTime()); metadata.setEndTime(fullExFlow.getEndTime()); metadata.setSubmitUser(fullExFlow.getSubmitUser()); return metadata; }
page.add("flowid", flow.getId()); page.add("parentflowid", node.getParentFlow().getFlowId()); page.add("jobname", node.getId());
page.add("flowid", flow.getId()); page.add("parentflowid", node.getParentFlow().getFlowId()); page.add("jobname", node.getId());
final String giveUpReason = checkGiveUpDispatching(reference, remainingExecutors); if (giveUpReason != null) { logger.error("Failed to dispatch queued execution " + exflow.getId() + " because " + giveUpReason); finalizeFlows(exflow);
throws ExecutorManagerException { final String exFlowKey = exflow.getProjectName() + "." + exflow.getId() + ".submitFlow";
page.add("flowid", flow.getId()); page.add("parentflowid", node.getParentFlow().getFlowId()); page.add("jobname", node.getId());