diff --git a/gdsc-core-ij/src/test/java/uk/ac/sussex/gdsc/core/ij/ImageJUtilsTest.java b/gdsc-core-ij/src/test/java/uk/ac/sussex/gdsc/core/ij/ImageJUtilsTest.java index 093aa3e7..e9d4433a 100644 --- a/gdsc-core-ij/src/test/java/uk/ac/sussex/gdsc/core/ij/ImageJUtilsTest.java +++ b/gdsc-core-ij/src/test/java/uk/ac/sussex/gdsc/core/ij/ImageJUtilsTest.java @@ -266,11 +266,14 @@ void testClose() { @Test void testShowStatus() throws InterruptedException { + // Wait until status has expired. This should be 150ms + final int interval = 200; + Thread.sleep(interval); Assertions.assertTrue(ImageJUtils.showStatus("first")); Assertions.assertFalse(ImageJUtils.showStatus("second")); Assertions.assertFalse(ImageJUtils.showStatus(() -> "third")); // Wait until status has expired. This should be 150ms - Thread.sleep(200); + Thread.sleep(interval); Assertions.assertTrue(ImageJUtils.showStatus(() -> "fourth")); }