Add some logging to debug issue sometimes seen when running system tests
@@ -47,6 +47,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
+import java.nio.file.Files;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
@@ -61,6 +62,7 @@ import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
+import java.util.stream.Collectors;
import static com.yahoo.text.Lowercase.toLowerCase;
@@ -600,6 +602,7 @@ public class FilesApplicationPackage implements ApplicationPackage {
@Override
public ApplicationPackage preprocess(Zone zone, DeployLogger logger) throws IOException {
+ try {
IOUtils.recursiveDeleteDir(preprocessedDir);
IOUtils.copyDirectory(appDir, preprocessedDir, -1, (dir, name) -> !name.equals(preprocessed) &&
!name.equals(SERVICES) &&
@@ -611,6 +614,13 @@ public class FilesApplicationPackage implements ApplicationPackage {
FilesApplicationPackage preprocessed = fromFile(preprocessedDir, includeSourceFiles);
preprocessed.copyUserDefsIntoApplication();
return preprocessed;
+ } catch (FileNotFoundException e) {
+ // TODO: Temporary logging for debugging purposes
+ log.log(Level.INFO, "File not found. Files in application package dir: " + Files.list(appDir.toPath())
+ .map(java.nio.file.Path::toString)
+ .collect(Collectors.joining(",")));
+ throw e;
+ }
}
private File validateServicesFile() throws IOException {
