mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-26 15:38:34 +00:00
Raise watch service sensitivity, add a delay in the test for windows to make sure the poll has been done
This commit is contained in:
@@ -88,8 +88,17 @@ public class WatchServiceCacheFactory extends AbstractLogEnabled implements Cach
|
|||||||
getLogger().debug("Starting to watch path " + key);
|
getLogger().debug("Starting to watch path " + key);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
WatchEvent.Modifier[] mods;
|
||||||
|
try {
|
||||||
|
mods = new WatchEvent.Modifier[] {
|
||||||
|
com.sun.nio.file.SensitivityWatchEventModifier.HIGH
|
||||||
|
};
|
||||||
|
} catch (Throwable t) {
|
||||||
|
mods = null;
|
||||||
|
}
|
||||||
final WatchKey watchKey = key.register(watchService,
|
final WatchKey watchKey = key.register(watchService,
|
||||||
StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
|
new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY },
|
||||||
|
mods);
|
||||||
return new Registration(watchKey);
|
return new Registration(watchKey);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
@@ -44,6 +44,10 @@ public class DeleteRepoNativeIT {
|
|||||||
client.execute(o1, "clean", "install", "-e", "-B").assertSuccess();
|
client.execute(o1, "clean", "install", "-e", "-B").assertSuccess();
|
||||||
|
|
||||||
TestUtils.deleteDir(localMavenRepo, Os.current() != Os.WINDOWS);
|
TestUtils.deleteDir(localMavenRepo, Os.current() != Os.WINDOWS);
|
||||||
|
if (Os.current() == Os.WINDOWS) {
|
||||||
|
// On windows, we're using the service watcher which polls every 2s by default
|
||||||
|
Thread.sleep(2500);
|
||||||
|
}
|
||||||
|
|
||||||
final TestClientOutput o2 = new TestClientOutput();
|
final TestClientOutput o2 = new TestClientOutput();
|
||||||
client.execute(o2, "clean", "install", "-e", "-B").assertSuccess();
|
client.execute(o2, "clean", "install", "-e", "-B").assertSuccess();
|
||||||
|
Reference in New Issue
Block a user