@@ -206,15 +206,15 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
206206 });
207207
208208 try (var watch = watchConfig .start ()) {
209- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
209+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
210210 // At this point, the index of last-modified-times inside `watch` is
211211 // populated with initial values.
212212
213213 Files .writeString (directory .resolve ("a.txt" ), "foo" );
214214 Files .writeString (directory .resolve ("b.txt" ), "bar" );
215215 Files .delete (directory .resolve ("c.txt" ));
216216 Files .createFile (directory .resolve ("d.txt" ));
217- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
217+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
218218 // At this point, regular events have been generated for a.txt,
219219 // b.txt, c.txt, and d.txt by the file system. These events won't be
220220 // handled by `watch` just yet, though, because the semaphore is
@@ -227,7 +227,7 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
227227
228228 var overflow = new WatchEvent (WatchEvent .Kind .OVERFLOW , directory );
229229 ((EventHandlingWatch ) watch ).handleEvent (overflow );
230- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
230+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
231231 // At this point, the current thread has presumably slept long
232232 // enough for the `OVERFLOW` event to have been handled by the
233233 // rescanner. This means that synthetic events must have been issued
@@ -236,7 +236,7 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
236236
237237 // Readiness achieved: Threads can now start handling non-`OVERFLOW`
238238 // events.
239- semaphore .release ();
239+ semaphore .release (99 );
240240
241241 await ("Overflow should trigger created events" )
242242 .until (nCreated ::get , n -> n >= 2 ); // 1 synthetic event + >=1 regular event
@@ -270,7 +270,6 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
270270 var nDeletedBeforeOverflow = nDeleted .get ();
271271
272272 ((EventHandlingWatch ) watch ).handleEvent (overflow );
273- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
274273
275274 await ("Overflow shouldn't trigger synthetic created event after file create (and index updated)" )
276275 .until (nCreated ::get , Predicate .isEqual (nCreatedBeforeOverflow ));
0 commit comments