@Deprecated
    public PassiveCompletableFuture<TaskExecutionState> deployLocalTask(
            @NonNull TaskGroup taskGroup) {
        return deployLocalTask(
                taskGroup, Thread.currentThread().getContextClassLoader(), emptyList());
    }
@Test
    public void testCriticalCallTime() throws InterruptedException {
        AtomicBoolean stopMark = new AtomicBoolean(false);
        CopyOnWriteArrayList<Long> stopTime = new CopyOnWriteArrayList<>();

        int count = 100;

        // Must be the same as the timer timeout
        int callTime = 50;

        // Create tasks with critical delays
        List<Task> criticalTask = buildStopTestTask(callTime, count, stopMark, stopTime);

        TaskExecutionService taskExecutionService = server.getTaskExecutionService();

        CompletableFuture<TaskExecutionState> taskCts =
                taskExecutionService.deployLocalTask(
                        new TaskGroupDefaultImpl(
                                new TaskGroupLocation(
                                        jobId, pipeLineId, FLAKE_ID_GENERATOR.newId()),
                                "t1",
                                Lists.newArrayList(criticalTask)));

        // Run it for a while
        Thread.sleep(taskRunTime);

        // stop task
        stopMark.set(true);

        // Check all task ends right
        await().atMost(count * callTime, TimeUnit.MILLISECONDS)
                .untilAsserted(() -> assertEquals(FINISHED, taskCts.get().getExecutionState()));

        // Check that each Task is only Done once
        assertEquals(count, stopTime.size());
    }