Skip to content

Commit 9446dcf

Browse files
committed
Add sleep time to allow test to catch up with events
1 parent d7fa0d1 commit 9446dcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/java/engineering/swat/watch/SingleDirectoryTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
213213
Files.writeString(directory.resolve("b.txt"), "bar");
214214
Files.delete(directory.resolve("c.txt"));
215215
Files.createFile(directory.resolve("d.txt"));
216+
Thread.sleep(TestHelper.NORMAL_WAIT.toMillis());
216217
// At this point, regular events have been generated for a.txt,
217218
// b.txt, c.txt, and d.txt by the file system. These events won't be
218219
// handled by `watch` just yet, though, because the semaphore is
@@ -225,7 +226,6 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
225226

226227
var overflow = new WatchEvent(WatchEvent.Kind.OVERFLOW, directory);
227228
((EventHandlingWatch) watch).handleEvent(overflow);
228-
Thread.sleep(TestHelper.NORMAL_WAIT.toMillis());
229229
Thread.sleep(TestHelper.LONG_WAIT.toMillis());
230230
// At this point, the current thread has presumably slept long
231231
// enough for the `OVERFLOW` event to have been handled by the

0 commit comments

Comments
 (0)