void () { ProgressIndicatorBase outer = new ProgressIndicatorBase(); waitForFuture(ApplicationManager.getApplication().executeOnPooledThread(() -> { ProgressManager.getInstance().runProcess(() -> { assertThrows(ProcessCanceledException.class, () -> { ReadAction.nonBlocking(() -> { outer.cancel(); ProgressManager.checkCanceled(); }).executeSynchronously(); }); }, outer); })); }