void () { final EmptyProgressIndicator threadIndicator = new EmptyProgressIndicator(ModalityState.defaultModalityState()); ProgressIndicatorUtils.awaitWithCheckCanceled( ApplicationManager.getApplication().executeOnPooledThread( () -> ProgressManager.getInstance().executeProcessUnderProgress( () -> BackgroundTaskUtil.runUnderDisposeAwareIndicator( getTestRootDisposable(), () -> { threadIndicator.cancel(); ProgressManager.checkCanceled(); fail(); }), threadIndicator ) )); }