diff -r 8462b295c08b -r bb40a5303c84 test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java Thu Jan 31 17:48:29 2019 -0800 +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbLauncher.java Fri Feb 01 11:29:31 2019 +0530 @@ -33,6 +33,7 @@ import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.SA.SATestUtils; +import jtreg.SkippedException; /** @@ -177,22 +178,18 @@ List commands, Map> expectedStrMap, Map> unExpectedStrMap) - throws IOException, InterruptedException { + throws Exception { if (!Platform.shouldSAAttach()) { - if (Platform.isOSX()) { - if (!SATestUtils.canAddPrivileges()) { - // Skip the test if we don't have enough permissions to attach - // and cannot add privileges. - System.out.println("SA attach not expected to work - test skipped."); - return null; - } else { - needPrivileges = true; - } - } else { - System.out.println("SA attach not expected to work. Insufficient privileges."); - throw new Error("Cannot attach."); + if (Platform.isOSX() && SATestUtils.canAddPrivileges()) { + needPrivileges = true; } + else { + // Skip the test if we don't have enough permissions to attach + // and cannot add privileges. + throw new SkippedException( + "SA attach not expected to work. Insufficient privileges."); + } } attach(lingeredAppPid);