@Test
    public void testIsLazyEvaluateWorkflow() {
        // setup
        WorkflowDef workflowDef = new WorkflowDef();
        workflowDef.setName("lazyEvaluate");
        workflowDef.setVersion(1);

        WorkflowTask simpleTask = new WorkflowTask();
        simpleTask.setType(SIMPLE.name());
        simpleTask.setName("simple");
        simpleTask.setTaskReferenceName("simple");

        WorkflowTask forkTask = new WorkflowTask();
        forkTask.setType(FORK_JOIN.name());
        forkTask.setName("fork");
        forkTask.setTaskReferenceName("fork");

        WorkflowTask branchTask1 = new WorkflowTask();
        branchTask1.setType(SIMPLE.name());
        branchTask1.setName("branchTask1");
        branchTask1.setTaskReferenceName("branchTask1");

        WorkflowTask branchTask2 = new WorkflowTask();
        branchTask2.setType(SIMPLE.name());
        branchTask2.setName("branchTask2");
        branchTask2.setTaskReferenceName("branchTask2");

        forkTask.getForkTasks().add(Arrays.asList(branchTask1, branchTask2));

        WorkflowTask joinTask = new WorkflowTask();
        joinTask.setType(JOIN.name());
        joinTask.setName("join");
        joinTask.setTaskReferenceName("join");
        joinTask.setJoinOn(List.of("branchTask2"));

        WorkflowTask doWhile = new WorkflowTask();
        doWhile.setType(DO_WHILE.name());
        doWhile.setName("doWhile");
        doWhile.setTaskReferenceName("doWhile");

        WorkflowTask loopTask = new WorkflowTask();
        loopTask.setType(SIMPLE.name());
        loopTask.setName("loopTask");
        loopTask.setTaskReferenceName("loopTask");

        doWhile.setLoopOver(List.of(loopTask));

        workflowDef.getTasks().addAll(List.of(simpleTask, forkTask, joinTask, doWhile));

        TaskModel task = new TaskModel();
        task.setStatus(TaskModel.Status.COMPLETED);

        // when:
        task.setReferenceTaskName("dynamic");
        assertTrue(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));

        task.setReferenceTaskName("branchTask1");
        assertFalse(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));

        task.setReferenceTaskName("branchTask2");
        assertTrue(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));

        task.setReferenceTaskName("simple");
        assertFalse(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));

        task.setReferenceTaskName("loopTask__1");
        task.setIteration(1);
        assertFalse(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));

        task.setReferenceTaskName("branchTask1");
        task.setStatus(TaskModel.Status.FAILED);
        assertFalse(workflowExecutor.isLazyEvaluateWorkflow(workflowDef, task));
    }
Simulate Queue push failures and assert that scheduleTask doesn't throw an exception.
core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java