8251121: six SA tests leave core files behind on macOS
Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
c202bd705e
commit
db46b297fa
@ -174,7 +174,6 @@ public class ClhsdbCDSCore {
|
||||
}
|
||||
|
||||
private static void cleanup() {
|
||||
if (coreFileName != null) remove(coreFileName);
|
||||
remove(SHARED_ARCHIVE_NAME);
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,20 @@ public class CoreUtils {
|
||||
// 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!
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user