void () { AtomicInteger processed = new AtomicInteger(); Processor<String> processor = __ -> { int next = processed.incrementAndGet(); busySleepAndIncrement(next % 4, ProgressManager::checkCanceled); return next % 100 != 0; }; int N = Timings.adjustAccordingToMySpeed(10_000, true); for (int i = 0; i<100 && checkTestTimeout(i); i++) { processed.set(0); ProgressIndicator indicator = new ProgressIndicatorBase(); boolean result = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(Collections.nCopies(N, ""), indicator, processor); assertFalse(indicator.isCanceled()); assertFalse(result); } }