void () { if (TEST_DELAY_MS <= 0) { return; } ProgressIndicator progress = Objects.requireNonNull(ProgressIndicatorProvider.getGlobalProgressIndicator()); long start = System.currentTimeMillis(); while (true) { progress.checkCanceled(); if (System.currentTimeMillis() - start > TEST_DELAY_MS) { break; } TimeoutUtil.sleep(1); } }