< prev index next >

test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java

Print this page
rev 57062 : 8234625: hs test serviceability/sa/ClhsdbCDSCore.java fails on macOS 10.15

@@ -109,12 +109,25 @@
             SATestUtils.unzipCores(new File("."));
             String coreFileLocation = getCoreFileLocation(crashOutputString);
             if (coreFileLocation == null) {
                 if (Platform.isOSX()) {
                     File coresDir = new File("/cores");
-                    if (!coresDir.isDirectory() || !coresDir.canWrite()) {
-                        throw new Error("cores is not a directory or does not have write permissions");
+                    if (!coresDir.isDirectory()) {
+                        throw new Error("cores is not a directory");
+                    }
+                    // the /cores directory is usually not writable on macOS 10.15
+                    final String osVersion = System.getProperty("os.version");
+                    if (osVersion == null) {
+                        throw new Error("Cannot query the 'os.version' property!");
+                    }
+                    if (!coresDir.canWrite()) {
+                        if (osVersion.startsWith("10.15")) {
+                            System.out.println("on macOS 10.15 /cores is usually not writable, skipping test.");
+                            return;
+                        } else {
+                            throw new Error("cores does not have write permissions");
+                        }
                     }
                 } else if (Platform.isLinux()) {
                     // Check if a crash report tool is installed.
                     File corePatternFile = new File(CORE_PATTERN_FILE_NAME);
                     Scanner scanner = new Scanner(corePatternFile);
< prev index next >