Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8251121: six SA tests leave core files behind on macOS
Reviewed-by: dholmes, dcubed
  • Loading branch information
plummercj committed Aug 7, 2020
1 parent 8133222 commit 19d757e3107030004a36eb836ccaa0d940e708dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
@@ -174,7 +174,6 @@ public static void main(String[] args) throws Exception {
}

private static void cleanup() {
if (coreFileName != null) remove(coreFileName);
remove(SHARED_ARCHIVE_NAME);
}

@@ -107,8 +107,20 @@ public static String getCoreFileLocation(String crashOutputString) throws IOExce
// Find the core file
String coreFileLocation = parseCoreFileLocationFromOutput(crashOutputString);
if (coreFileLocation != null) {
Asserts.assertGT(new File(coreFileLocation).length(), 0L, "Unexpected core size");
System.out.println("Found core file: " + coreFileLocation);
Asserts.assertGT(new File(coreFileLocation).length(), 0L, "Unexpected core size");

// Make sure the core file is moved into the cwd if not already there.
Path corePath = Paths.get(coreFileLocation);
if (corePath.getParent() != null) {
Path coreFileName = corePath.getFileName();
System.out.println("Moving core file to cwd: " + coreFileName);
long startTime = System.currentTimeMillis();
Files.move(corePath, coreFileName);
System.out.println("Core file move took " + (System.currentTimeMillis() - startTime) + "ms");
coreFileLocation = coreFileName.toString();
}

return coreFileLocation; // success!
}

0 comments on commit 19d757e

Please sign in to comment.