diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestProcessUtility.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestProcessUtility.java index 0e8f3f73d..76792c5fb 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestProcessUtility.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestProcessUtility.java @@ -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); diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestUtility.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestUtility.java index bd2c2c4e4..e7badf2f0 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestUtility.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/npm/LockfileTestUtility.java @@ -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); }