From 40b76c633276fcd6aea165baeae74039b2d059c4 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 15 May 2023 01:21:30 -0400 Subject: [PATCH] Fix flaky obtainTasksFromPlugin() test --- .../velocitypowered/proxy/scheduler/VelocitySchedulerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/test/java/com/velocitypowered/proxy/scheduler/VelocitySchedulerTest.java b/proxy/src/test/java/com/velocitypowered/proxy/scheduler/VelocitySchedulerTest.java index 70cd20b100..e31a8a7e3f 100644 --- a/proxy/src/test/java/com/velocitypowered/proxy/scheduler/VelocitySchedulerTest.java +++ b/proxy/src/test/java/com/velocitypowered/proxy/scheduler/VelocitySchedulerTest.java @@ -76,12 +76,12 @@ void obtainTasksFromPlugin() throws Exception { scheduler.buildTask(FakePluginManager.PLUGIN_A, task -> { runningLatch.countDown(); - task.cancel(); try { endingLatch.await(); } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); } + task.cancel(); }).delay(50, TimeUnit.MILLISECONDS) .repeat(Duration.ofMillis(5)) .schedule();