Skip to content

Commit 59d85ba

Browse files
committed
8290687: serviceability/sa/TestClassDump.java could leave files owned by root on macOS
Reviewed-by: amenkov, lmesnik
1 parent 66f59c2 commit 59d85ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
3030
import jdk.test.lib.process.OutputAnalyzer;
3131
import jdk.test.lib.process.ProcessTools;
3232
import jdk.test.lib.SA.SATestUtils;
33+
import jtreg.SkippedException;
3334

3435
/**
3536
* @test
@@ -87,6 +88,10 @@ private static void dumpClass(long lingeredAppPid)
8788

8889
public static void main(String[] args) throws Exception {
8990
SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
91+
if (SATestUtils.needsPrivileges()) {
92+
// This test will create files as root that cannot be easily deleted, so don't run.
93+
throw new SkippedException("Cannot run this test on OSX if adding privileges is required.");
94+
}
9095
LingeredApp theApp = null;
9196
try {
9297
theApp = LingeredApp.startApp();

0 commit comments

Comments
 (0)