use of org.jenkinsci.plugins.workflow.flow.FlowExecutionList in project workflow-cps-plugin by jenkinsci.
the class FlowDurabilityTest method verifyExecutionRemoved.
private static void verifyExecutionRemoved(WorkflowRun run) throws Exception {
// Verify we've removed all FlowExcecutionList entries
FlowExecutionList list = FlowExecutionList.get();
for (FlowExecution fe : list) {
if (fe == run.getExecution()) {
Assert.fail("Run still has an execution in the list and should be removed!");
}
}
Field f = list.getClass().getDeclaredField("runningTasks");
f.setAccessible(true);
CopyOnWriteList<FlowExecutionOwner> runningTasks = (CopyOnWriteList<FlowExecutionOwner>) (f.get(list));
Assert.assertFalse(runningTasks.contains(run.asFlowExecutionOwner()));
}
Aggregations