@@ -206,15 +206,15 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
206
206
});
207
207
208
208
try (var watch = watchConfig .start ()) {
209
- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
209
+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
210
210
// At this point, the index of last-modified-times inside `watch` is
211
211
// populated with initial values.
212
212
213
213
Files .writeString (directory .resolve ("a.txt" ), "foo" );
214
214
Files .writeString (directory .resolve ("b.txt" ), "bar" );
215
215
Files .delete (directory .resolve ("c.txt" ));
216
216
Files .createFile (directory .resolve ("d.txt" ));
217
- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
217
+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
218
218
// At this point, regular events have been generated for a.txt,
219
219
// b.txt, c.txt, and d.txt by the file system. These events won't be
220
220
// handled by `watch` just yet, though, because the semaphore is
@@ -227,7 +227,7 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
227
227
228
228
var overflow = new WatchEvent (WatchEvent .Kind .OVERFLOW , directory );
229
229
((EventHandlingWatch ) watch ).handleEvent (overflow );
230
- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
230
+ Thread .sleep (TestHelper .SHORT_WAIT .toMillis ());
231
231
// At this point, the current thread has presumably slept long
232
232
// enough for the `OVERFLOW` event to have been handled by the
233
233
// rescanner. This means that synthetic events must have been issued
@@ -236,7 +236,7 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
236
236
237
237
// Readiness achieved: Threads can now start handling non-`OVERFLOW`
238
238
// events.
239
- semaphore .release ();
239
+ semaphore .release (99 );
240
240
241
241
await ("Overflow should trigger created events" )
242
242
.until (nCreated ::get , n -> n >= 2 ); // 1 synthetic event + >=1 regular event
@@ -270,7 +270,6 @@ void indexingRescanOnOverflow() throws IOException, InterruptedException {
270
270
var nDeletedBeforeOverflow = nDeleted .get ();
271
271
272
272
((EventHandlingWatch ) watch ).handleEvent (overflow );
273
- Thread .sleep (TestHelper .NORMAL_WAIT .toMillis ());
274
273
275
274
await ("Overflow shouldn't trigger synthetic created event after file create (and index updated)" )
276
275
.until (nCreated ::get , Predicate .isEqual (nCreatedBeforeOverflow ));
0 commit comments