void () { final AtomicBoolean secondTaskCompleted = new AtomicBoolean(false); // Run two tasks one after another. Then terminate the first (parent) task and check that the second (child) task complete successfully service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { service().runTaskSynchronously(new DumbModeTask() { @Override public void performInDumbMode(@NotNull ProgressIndicator indicator) { secondTaskCompleted.set(true); } }); // cancel parent task now. The child task should complete successfully throw new ProcessCanceledException(); } }); Assert.assertTrue("Cancellation of the first task should not terminate execution of the second task", secondTaskCompleted.get()); }