Fix flaky obtainTasksFromPlugin() test

This commit is contained in:
Andrew Steinborn
2023-05-15 01:21:30 -04:00
parent 92ae25b8ac
commit 40b76c6332

View File

@@ -76,12 +76,12 @@ class VelocitySchedulerTest {
scheduler.buildTask(FakePluginManager.PLUGIN_A, task -> { scheduler.buildTask(FakePluginManager.PLUGIN_A, task -> {
runningLatch.countDown(); runningLatch.countDown();
task.cancel();
try { try {
endingLatch.await(); endingLatch.await();
} catch (InterruptedException ignored) { } catch (InterruptedException ignored) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
task.cancel();
}).delay(50, TimeUnit.MILLISECONDS) }).delay(50, TimeUnit.MILLISECONDS)
.repeat(Duration.ofMillis(5)) .repeat(Duration.ofMillis(5))
.schedule(); .schedule();