Fix classpath on windows + workaround for edge case on lock file
This commit is contained in:
parent
0fd25a6a98
commit
cce4d108ce
|
@ -62,7 +62,7 @@ public class LockfileTestProcessUtility {
|
|||
*/
|
||||
public static Thread lockWaitAndDeleteInNewProcess(String path, String lockFileName, int seconds) {
|
||||
Thread t = new Thread(() -> {
|
||||
ProcessBuilder processBuilder = new ProcessBuilder("java", "-cp", "target/test-classes:.", LockfileTestProcessUtility.class.getName(), path, lockFileName, Integer.toString(seconds));
|
||||
ProcessBuilder processBuilder = new ProcessBuilder("java", "-cp", "target/test-classes", LockfileTestProcessUtility.class.getName(), path, lockFileName, Integer.toString(seconds));
|
||||
try {
|
||||
Process process = processBuilder.start();
|
||||
process.getErrorStream().transferTo(System.err);
|
||||
|
|
|
@ -66,6 +66,11 @@ public class LockfileTestUtility {
|
|||
if (!success) {
|
||||
throw new TimeoutException("Timed out waiting for lock file creation: " + lockFileName);
|
||||
}
|
||||
// TODO This is a workaround for an edge condition that shows up with testing, where the lock is not reflected in
|
||||
// the file system immediately. It is unlikely to appear in production environments, but should it occur, it will
|
||||
// result in a lock file being erroneously reported as not having an owning process, and will cause a package to
|
||||
// fail to be loaded from that cache until the lock is cleaned up by cache initialization.
|
||||
Thread.sleep(100);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue