void () { List<Integer> ints = IntStream.range(1, 123_271*JobSchedulerImpl.getJobPoolParallelism()/11).boxed().collect(Collectors.toList()); for (int i = 0; i<100 && checkTestTimeout(i); i++) { AtomicInteger executed = new AtomicInteger(); AtomicBoolean returnedFalse = new AtomicBoolean(); boolean result = JobLauncher.getInstance().invokeConcurrentlyUnderProgress(ints, new DaemonProgressIndicator(), n -> { if (!returnedFalse.get()) { TimeoutUtil.sleep(ThreadLocalRandom.current().nextBoolean() ? 1 : 0); } executed.incrementAndGet(); if (n % 10_000 == 0) { returnedFalse.set(true); return false; } return true; }); int count = executed.get(); assertFalse(result); TestTimeOut w = setTimeout(1000, TimeUnit.MILLISECONDS); while (!w.isTimedOut()) { assertEquals(count, executed.get()); } } }