diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestFileSafety.java b/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestFileSafety.java index 68d77c5455c..74f98d5b777 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestFileSafety.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestFileSafety.java @@ -141,6 +141,9 @@ public class JCmdTestFileSafety extends JCmdTestDumpBase { // to create archive successfully which is not expected. throw new jtreg.SkippedException("Test skipped on Windows"); } + if (Platform.isRoot()) { + throw new jtreg.SkippedException("Test skipped when executed by root user."); + } runTest(JCmdTestFileSafety::test); } }