changeset 58637:d8c2f47ea47d

8240698: LingeredApp does not pass getTestJavaOpts() to the children process if vmArguments is already specified Reviewed-by: iignatyev, iklam, cjplummer
author lmesnik
date Wed, 01 Apr 2020 16:27:03 -0700
parents a078359893a5
children 888a01721217
files test/hotspot/jtreg/ProblemList-aot.txt test/hotspot/jtreg/ProblemList-zgc.txt test/hotspot/jtreg/ProblemList.txt test/hotspot/jtreg/resourcehogs/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java test/hotspot/jtreg/resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java test/jdk/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java test/jdk/sun/tools/jinfo/JInfoTest.java test/lib/jdk/test/lib/apps/LingeredApp.java
diffstat 22 files changed, 112 insertions(+), 95 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/ProblemList-aot.txt	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/ProblemList-aot.txt	Wed Apr 01 16:27:03 2020 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -32,12 +32,15 @@
 serviceability/sa/ClhsdbCDSCore.java                    8216181   generic-all
 serviceability/sa/ClhsdbCDSJstackPrintAll.java          8216181   generic-all
 serviceability/sa/ClhsdbField.java                      8216181   generic-all
-serviceability/sa/ClhsdbFindPC.java                     8216181   generic-all
+serviceability/sa/ClhsdbFindPC.java#id0                 8216181   generic-all
+serviceability/sa/ClhsdbFindPC.java#id1                 8216181   generic-all
 serviceability/sa/ClhsdbFlags.java                      8216181   generic-all
 serviceability/sa/ClhsdbInspect.java                    8216181   generic-all
 serviceability/sa/ClhsdbJdis.java                       8216181   generic-all
 serviceability/sa/ClhsdbJhisto.java                     8216181   generic-all
-serviceability/sa/ClhsdbJstack.java                     8216181   generic-all
+serviceability/sa/ClhsdbJstack.java#id0                 8216181   generic-all
+serviceability/sa/ClhsdbJstack.java#id1                 8216181   generic-all
+serviceability/sa/ClhsdbJstackXcompStress.java          8216181   generic-all
 serviceability/sa/ClhsdbLongConstant.java               8216181   generic-all
 serviceability/sa/ClhsdbPmap.java                       8216181   generic-all
 serviceability/sa/ClhsdbPrintAll.java                   8216181   generic-all
@@ -45,7 +48,8 @@
 serviceability/sa/ClhsdbPrintStatics.java               8216181   generic-all
 serviceability/sa/ClhsdbPstack.java                     8216181   generic-all
 serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 8216181   generic-all
-serviceability/sa/ClhsdbScanOops.java                   8216181   generic-all
+serviceability/sa/ClhsdbScanOops.java#id0               8216181   generic-all
+serviceability/sa/ClhsdbScanOops.java#id1               8216181   generic-all
 serviceability/sa/ClhsdbSource.java                     8216181   generic-all
 serviceability/sa/ClhsdbThread.java                     8216181   generic-all
 serviceability/sa/ClhsdbVmStructsDump.java              8216181   generic-all
--- a/test/hotspot/jtreg/ProblemList-zgc.txt	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/ProblemList-zgc.txt	Wed Apr 01 16:27:03 2020 -0700
@@ -28,10 +28,16 @@
 #############################################################################
 
 resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java 8220624   generic-all
+serviceability/sa/CDSJMapClstats.java                         8220624   generic-all
+serviceability/sa/ClhsdbCDSJstackPrintAll.java                8220624   generic-all
+serviceability/sa/ClhsdbFindPC.java#id0                       8220624   generic-all
+serviceability/sa/ClhsdbFindPC.java#id1                       8220624   generic-all
 serviceability/sa/ClhsdbInspect.java                          8220624   generic-all
 serviceability/sa/ClhsdbJdis.java                             8220624   generic-all
 serviceability/sa/ClhsdbJhisto.java                           8220624   generic-all
-serviceability/sa/ClhsdbJstack.java                           8220624   generic-all
+serviceability/sa/ClhsdbJstack.java#id0                       8220624   generic-all
+serviceability/sa/ClhsdbJstack.java#id1                       8220624   generic-all
+serviceability/sa/ClhsdbJstackXcompStress.java                8220624   generic-all
 serviceability/sa/ClhsdbPrintAs.java                          8220624   generic-all
 serviceability/sa/ClhsdbPrintStatics.java                     8220624   generic-all
 serviceability/sa/ClhsdbPstack.java                           8220624   generic-all
--- a/test/hotspot/jtreg/ProblemList.txt	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/ProblemList.txt	Wed Apr 01 16:27:03 2020 -0700
@@ -103,7 +103,8 @@
 serviceability/sa/ClhsdbCDSJstackPrintAll.java 8193639 solaris-all
 serviceability/sa/CDSJMapClstats.java 8193639 solaris-all
 serviceability/sa/ClhsdbField.java 8193639 solaris-all
-serviceability/sa/ClhsdbFindPC.java 8193639 solaris-all
+serviceability/sa/ClhsdbFindPC.java#id0 8193639 solaris-all
+serviceability/sa/ClhsdbFindPC.java#id1 8193639 solaris-all
 serviceability/sa/ClhsdbFlags.java 8193639 solaris-all
 serviceability/sa/ClhsdbInspect.java 8193639 solaris-all
 serviceability/sa/ClhsdbJdis.java 8193639 solaris-all
@@ -117,7 +118,8 @@
 serviceability/sa/ClhsdbPrintStatics.java 8193639 solaris-all
 serviceability/sa/ClhsdbPstack.java 8193639 solaris-all
 serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 8193639 solaris-all
-serviceability/sa/ClhsdbScanOops.java 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
+serviceability/sa/ClhsdbScanOops.java#id0 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
+serviceability/sa/ClhsdbScanOops.java#id1 8193639,8235220,8230731 solaris-all,linux-x64,macosx-x64,windows-x64
 serviceability/sa/ClhsdbSource.java 8193639 solaris-all
 serviceability/sa/ClhsdbThread.java 8193639 solaris-all
 serviceability/sa/ClhsdbVmStructsDump.java 8193639 solaris-all
@@ -125,7 +127,7 @@
 serviceability/sa/DeadlockDetectionTest.java 8193639 solaris-all
 serviceability/sa/JhsdbThreadInfoTest.java 8193639 solaris-all
 serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 8193639 solaris-all
-serviceability/sa/sadebugd/DebugdConnectTest.java 8239062 macosx-x64 
+serviceability/sa/sadebugd/DebugdConnectTest.java 8239062 macosx-x64
 serviceability/sa/TestClassDump.java 8193639 solaris-all
 serviceability/sa/TestClhsdbJstackLock.java 8193639 solaris-all
 serviceability/sa/TestCpoolForInvokeDynamic.java 8193639 solaris-all
--- a/test/hotspot/jtreg/resourcehogs/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/resourcehogs/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java	Wed Apr 01 16:27:03 2020 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 8175312
  * @summary Test clhsdb 'g1regiondetails' and 'scanoops' commands for G1GC
+ * @requires vm.gc.G1
  * @requires vm.hasSA & (vm.bits == "64" & os.maxMemory > 8g)
  * @library /test/lib /test/hotspot/jtreg/serviceability/sa
  * @run main/othervm/timeout=2400 ClhsdbRegionDetailsScanOopsForG1
--- a/test/hotspot/jtreg/resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java	Wed Apr 01 16:27:03 2020 -0700
@@ -21,23 +21,11 @@
  * questions.
  */
 
-import java.util.ArrayList;
-import java.util.List;
 import java.io.File;
-import java.nio.file.Files;
-import java.io.IOException;
-import java.io.BufferedInputStream;
 import java.util.stream.Collectors;
-import java.io.FileInputStream;
-
-import sun.jvm.hotspot.HotSpotAgent;
-import sun.jvm.hotspot.debugger.*;
 
 import jdk.test.lib.apps.LingeredApp;
-import jdk.test.lib.Asserts;
 import jdk.test.lib.JDKToolLauncher;
-import jdk.test.lib.JDKToolFinder;
-import jdk.test.lib.Platform;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.SA.SATestUtils;
@@ -104,7 +92,7 @@
                 "-Xmx8g");
 
             theApp = new LingeredAppWithLargeArray();
-            LingeredApp.startApp(theApp, vmArgs);
+            LingeredApp.startAppExactJvmOpts(theApp, vmArgs);
             attachAndDump(heapDumpFileName, theApp.getPid());
         } finally {
             LingeredApp.stopApp(theApp);
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Wed Apr 01 16:27:03 2020 -0700
@@ -36,7 +36,18 @@
  * @requires vm.hasSA
  * @requires vm.compiler1.enabled
  * @library /test/lib
- * @run main/othervm/timeout=480 ClhsdbFindPC
+ * @run main/othervm/timeout=480 ClhsdbFindPC true
+ */
+
+/**
+ * @test
+ * @bug 8193124
+ * @summary Test the clhsdb 'findpc' command
+ * @requires vm.compMode != "Xcomp"
+ * @requires vm.hasSA
+ * @requires vm.compiler1.enabled
+ * @library /test/lib
+ * @run main/othervm/timeout=480 ClhsdbFindPC false
  */
 
 public class ClhsdbFindPC {
@@ -104,9 +115,9 @@
     }
 
     public static void main(String[] args) throws Exception {
+        boolean xComp = Boolean.parseBoolean(args[0]);
         System.out.println("Starting the ClhsdbFindPC test");
-        testFindPC(true);
-        testFindPC(false);
+        testFindPC(xComp);
         System.out.println("Test PASSED");
     }
 }
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java	Wed Apr 01 16:27:03 2020 -0700
@@ -21,7 +21,6 @@
  * questions.
  */
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -49,11 +48,10 @@
         LingeredApp theApp = null;
         try {
             ClhsdbLauncher test = new ClhsdbLauncher();
-            String[] vmArgs = Utils.appendTestJavaOpts(
-                "-XX:+UnlockExperimentalVMOptions",
-                "-XX:+UnlockDiagnosticVMOptions",
-                "-XX:-MaxFDLimit");
-            theApp = LingeredApp.startApp(vmArgs);
+            theApp = LingeredApp.startApp(
+                    "-XX:+UnlockExperimentalVMOptions",
+                    "-XX:+UnlockDiagnosticVMOptions",
+                    "-XX:-MaxFDLimit");
             System.out.println("Started LingeredApp with pid " + theApp.getPid());
 
             List<String> cmds = List.of(
@@ -111,7 +109,8 @@
                 "-XX:OnError='echo error'",        // ccstrlist
                 "-XX:CompileThresholdScaling=1.0", // double
                 "-XX:ErrorLogTimeout=120");        // uint64_t
-            theApp = LingeredApp.startApp(vmArgs);
+            theApp = new LingeredApp();
+            LingeredApp.startAppExactJvmOpts(theApp, vmArgs);
             System.out.println("Started LingeredApp with pid " + theApp.getPid());
 
             List<String> cmds = List.of("flags");
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java	Wed Apr 01 16:27:03 2020 -0700
@@ -34,7 +34,17 @@
  * @summary Test clhsdb Jstack command
  * @requires vm.hasSA
  * @library /test/lib
- * @run main/othervm/timeout=480 ClhsdbJstack
+ * @run main/othervm/timeout=480 ClhsdbJstack true
+ */
+
+/**
+ * @test
+ * @bug 8190198
+ * @requires vm.compMode != "Xcomp"
+ * @summary Test clhsdb Jstack command
+ * @requires vm.hasSA
+ * @library /test/lib
+ * @run main/othervm/timeout=480 ClhsdbJstack false
  */
 
 public class ClhsdbJstack {
@@ -74,9 +84,9 @@
     }
 
     public static void main(String[] args) throws Exception {
+        boolean xComp = Boolean.parseBoolean(args[0]);
         System.out.println("Starting ClhsdbJstack test");
-        testJstack(false);
-        testJstack(true);
+        testJstack(xComp);
         System.out.println("Test PASSED");
     }
 }
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java	Wed Apr 01 16:27:03 2020 -0700
@@ -25,9 +25,20 @@
  * @test
  * @bug 8192985
  * @summary Test the clhsdb 'scanoops' command
+ * @requires vm.gc.ParallelGC
  * @requires vm.hasSA
  * @library /test/lib
- * @run main/othervm/timeout=1200 ClhsdbScanOops
+ * @run main/othervm/timeout=1200 ClhsdbScanOops UseParallelGC
+ */
+
+/**
+ * @test
+ * @bug 8192985
+ * @summary Test the clhsdb 'scanoops' command
+ * @requires vm.gc.SerialGC
+ * @requires vm.hasSA
+ * @library /test/lib
+ * @run main/othervm/timeout=1200 ClhsdbScanOops UseSerialGC
  */
 
 import java.util.HashMap;
@@ -99,9 +110,9 @@
     }
 
     public static void main(String[] args) throws Exception {
+        String gc = args[0];
         System.out.println("Starting the ClhsdbScanOops test");
-        testWithGcType("-XX:+UseParallelGC");
-        testWithGcType("-XX:+UseSerialGC");
+        testWithGcType("-XX:+" + gc);
         System.out.println("Test PASSED");
     }
 }
--- a/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java	Wed Apr 01 16:27:03 2020 -0700
@@ -77,10 +77,8 @@
         }
 
         try {
-            String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
-
             theApp = new LingeredAppWithDeadlock();
-            LingeredApp.startApp(theApp, vmArgs);
+            LingeredApp.startApp(theApp, "-XX:+UsePerfData");
             OutputAnalyzer output = jstack("--pid", Long.toString(theApp.getPid()));
             System.out.println(output.getOutput());
 
--- a/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java	Wed Apr 01 16:27:03 2020 -0700
@@ -125,11 +125,8 @@
 
         if (args == null || args.length == 0) {
             try {
-                String[] vmArgs = Utils.appendTestJavaOpts(
-                    "-XX:+UsePerfData");
-
                 theApp = new LingeredAppWithInvokeDynamic();
-                LingeredApp.startApp(theApp, vmArgs);
+                LingeredApp.startApp(theApp, "-XX:+UsePerfData");
                 createAnotherToAttach(instanceKlassNames,
                                       theApp.getPid());
             } finally {
--- a/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java	Wed Apr 01 16:27:03 2020 -0700
@@ -135,10 +135,8 @@
 
         if (args == null || args.length == 0) {
             try {
-                String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
-
                 theApp = new LingeredAppWithDefaultMethods();
-                LingeredApp.startApp(theApp, vmArgs);
+                LingeredApp.startApp(theApp, "-XX:+UsePerfData");
                 createAnotherToAttach(instanceKlassNames,
                                       theApp.getPid());
             } finally {
--- a/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java	Wed Apr 01 16:27:03 2020 -0700
@@ -93,12 +93,8 @@
         SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
         if (args == null || args.length == 0) {
             try {
-                String[] vmArgs = Utils.appendTestJavaOpts(
-                    "-XX:+UsePerfData",
-                    "-XX:+UseG1GC");
-
                 theApp = new LingeredApp();
-                LingeredApp.startApp(theApp, vmArgs);
+                LingeredApp.startApp(theApp, "-XX:+UsePerfData", "-XX:+UseG1GC");
                 createAnotherToAttach(theApp.getPid());
             } finally {
                 LingeredApp.stopApp(theApp);
--- a/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java	Wed Apr 01 16:27:03 2020 -0700
@@ -121,12 +121,8 @@
         }
 
         try {
-            String[] vmArgs = Utils.appendTestJavaOpts(
-                "-XX:+UsePerfData",
-                "-Xmx512m");
-
             theApp = new LingeredAppWithInvokeDynamic();
-            LingeredApp.startApp(theApp, vmArgs);
+            LingeredApp.startApp(theApp, "-XX:+UsePerfData", "-Xmx512m");
             attachDumpAndVerify(heapDumpFileName, theApp.getPid());
         } finally {
             LingeredApp.stopApp(theApp);
--- a/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java	Wed Apr 01 16:27:03 2020 -0700
@@ -74,8 +74,7 @@
         LingeredApp app = null;
         OutputAnalyzer output = null;
         try {
-            String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
-            app = LingeredApp.startApp(vmArgs);
+            app = LingeredApp.startApp("-XX:+UsePerfData");
             System.out.println ("Started LingeredApp with pid " + app.getPid());
         } catch (Exception ex) {
             ex.printStackTrace();
--- a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixed.java	Wed Apr 01 16:27:03 2020 -0700
@@ -172,7 +172,7 @@
                 : Utils.getTestJavaOpts();
 
             app = new LingeredAppWithNativeMethod();
-            LingeredApp.startApp(app, vmArgs);
+            LingeredApp.startAppExactJvmOpts(app, vmArgs);
             System.out.println("Started LingeredApp with pid " + app.getPid());
             runJstackMixedInLoop(app);
             System.out.println("Test Completed");
--- a/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java	Wed Apr 01 16:27:03 2020 -0700
@@ -45,10 +45,7 @@
         LingeredApp app = null;
         try {
             ClhsdbLauncher test = new ClhsdbLauncher();
-            String[] vmArgs = Utils.appendTestJavaOpts(
-                "-XX:+ProfileInterpreter");
-
-            app = LingeredApp.startApp(vmArgs);
+            app = LingeredApp.startApp("-XX:+ProfileInterpreter");
             System.out.println ("Started LingeredApp with pid " + app.getPid());
             List<String> cmds = List.of("printmdo -a");
 
--- a/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java	Wed Apr 01 16:27:03 2020 -0700
@@ -85,10 +85,8 @@
         SATestUtils.skipIfCannotAttach(); // throws SkippedException if attach not expected to work.
         if (args == null || args.length == 0) {
             try {
-                String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
-
                 theApp = new LingeredAppWithInvokeDynamic();
-                LingeredApp.startApp(theApp, vmArgs);
+                LingeredApp.startApp(theApp, "-XX:+UsePerfData");
                 createAnotherToAttach(theApp.getPid());
             } finally {
                 LingeredApp.stopApp(theApp);
--- a/test/jdk/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/jdk/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java	Wed Apr 01 16:27:03 2020 -0700
@@ -54,8 +54,7 @@
             MonitorException, URISyntaxException {
         LingeredApp app = null;
         try {
-            String[] vmArgs = Utils.appendTestJavaOpts("-XX:+UsePerfData");
-            app = LingeredApp.startApp(vmArgs);
+            app = LingeredApp.startApp("-XX:+UsePerfData");
 
             MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
             String uriString = "//" + app.getPid() + "?mode=r"; // NOI18N
--- a/test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java	Wed Apr 01 16:27:03 2020 -0700
@@ -99,7 +99,8 @@
                 List<String> vmArgsExtended = new ArrayList<String>();
                 vmArgsExtended.add("-XX:+UsePerfData");
                 Collections.addAll(vmArgsExtended, vmArgs);
-                theApp = LingeredApp.startApp(vmArgsExtended.toArray(new String[0]));
+                theApp = new LingeredApp();
+                LingeredApp.startAppExactJvmOpts(theApp, vmArgsExtended.toArray(new String[0]));
 
                 System.out.println("Starting " + toolName + " against " + theApp.getPid());
                 JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
@@ -112,7 +113,7 @@
                 launcher.addToolArg(Long.toString(theApp.getPid()));
 
                 ProcessBuilder processBuilder = SATestUtils.createProcessBuilder(launcher);
-               processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
+                processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
                 Process toolProcess = processBuilder.start();
 
                 // By default child process output stream redirected to pipe, so we are reading it in foreground.
--- a/test/jdk/sun/tools/jinfo/JInfoTest.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/jdk/sun/tools/jinfo/JInfoTest.java	Wed Apr 01 16:27:03 2020 -0700
@@ -60,8 +60,8 @@
         LingeredApp app2 = new JInfoTestLingeredApp();
         try {
             String[] params = new String[0];;
-            LingeredApp.startApp(app1, params);
-            LingeredApp.startApp(app2, params);
+            LingeredApp.startAppExactJvmOpts(app1, params);
+            LingeredApp.startAppExactJvmOpts(app2, params);
             OutputAnalyzer output = jinfo("-flag", "MinHeapFreeRatio=1", "JInfoTestLingeredApp");
             output.shouldHaveExitValue(0);
             output = jinfo("-flag", "MinHeapFreeRatio", "JInfoTestLingeredApp");
@@ -85,8 +85,8 @@
         LingeredApp app2 = new JInfoTestLingeredApp();
         try {
             String[] params = new String[0];
-            LingeredApp.startApp(app1, params);
-            LingeredApp.startApp(app2, params);
+            LingeredApp.startAppExactJvmOpts(app1, params);
+            LingeredApp.startAppExactJvmOpts(app2, params);
             OutputAnalyzer output = jinfo("JInfoTestLingeredApp");
             output.shouldHaveExitValue(0);
             // "Runtime Environment" written once per proc
--- a/test/lib/jdk/test/lib/apps/LingeredApp.java	Wed Apr 01 20:53:46 2020 +0200
+++ b/test/lib/jdk/test/lib/apps/LingeredApp.java	Wed Apr 01 16:27:03 2020 -0700
@@ -57,7 +57,7 @@
  *
  *   a = new SmartTestApp("MyLock.lck");
  *   a.createLock();
- *   a.runApp();
+ *   a.runAppExactJvmOpts(Utils.getTestJavaOpts());
  *   a.waitAppReady();
  *     // do something
  *   a.deleteLock();
@@ -283,7 +283,7 @@
      * Analyze an environment and prepare a command line to
      * run the app, app name should be added explicitly
      */
-    public List<String> runAppPrepare(String[] vmArguments) {
+    private List<String> runAppPrepare(String[] vmArguments) {
         // We should always use testjava or throw an exception,
         // so we can't use JDKToolFinder.getJDKTool("java");
         // that falls back to compile java on error
@@ -303,13 +303,6 @@
 
         List<String> cmd = new ArrayList<String>();
         cmd.add(javapath);
-
-        if (vmArguments == null) {
-            // Propagate getTestJavaOpts() to LingeredApp
-            vmArguments = Utils.getTestJavaOpts();
-        } else {
-            // Lets user manage LingeredApp options
-        }
         Collections.addAll(cmd, vmArguments);
 
         // Make sure we set correct classpath to run the app
@@ -335,14 +328,14 @@
 
     /**
      * Run the app.
-     *
-     * @param vmArguments
+     * User should provide exact options to run app. Might use #Utils.getTestJavaOpts() to set default test options.
+     * @param vmOpts
      * @throws IOException
      */
-    public void runApp(String[] vmArguments)
+    public void runAppExactJvmOpts(String[] vmOpts)
             throws IOException {
 
-        List<String> cmd = runAppPrepare(vmArguments);
+        List<String> cmd = runAppPrepare(vmOpts);
 
         cmd.add(this.getAppName());
         cmd.add(lockFileName);
@@ -392,17 +385,19 @@
     /**
      *  High level interface for test writers
      */
+
     /**
      * Factory method that starts pre-created LingeredApp
      * lock name is autogenerated
-     * @param cmd - vm options, could be null to auto add Utils.getTestJavaOpts()
+     * User should provide exact options to run app. Might use #Utils.getTestJavaOpts() to set default test options.
+     * @param jvmOpts - the exact vm options used to start LingeredApp
      * @param theApp - app to start
      * @throws IOException
      */
-    public static void startApp(LingeredApp theApp, String... cmd) throws IOException {
+    public static void startAppExactJvmOpts(LingeredApp theApp, String... jvmOpts) throws IOException {
         theApp.createLock();
         try {
-            theApp.runApp(cmd);
+            theApp.runAppExactJvmOpts(jvmOpts);
             theApp.waitAppReady(appWaitTime);
         } catch (Exception ex) {
             theApp.deleteLock();
@@ -411,16 +406,27 @@
     }
 
     /**
+     * Factory method that starts pre-created LingeredApp
+     * lock name is autogenerated, additionalJvmOpts are appended to default test options
+     * @param additionalJvmOpts - additional Jvm options, appended to #Utils.getTestJavaOpts();
+     * @param theApp - app to start
+     * @throws IOException
+     */
+    public static void startApp(LingeredApp theApp, String... additionalJvmOpts) throws IOException {
+        startAppExactJvmOpts(theApp, Utils.prependTestJavaOpts(additionalJvmOpts));
+    }
+
+    /**
      * Factory method that creates LingeredApp object with ready to use application
-     * lock name is autogenerated
-     * @param cmd - vm options, could be null to auto add Utils.getTestJavaOpts()
+     * lock name is autogenerated, additionalJvmOpts are appended to default test options
+     * @param additionalJvmOpts - additional Jvm options, appended to #Utils.getTestJavaOpts();
      * @return LingeredApp object
      * @throws IOException
      */
-    public static LingeredApp startApp(String... cmd) throws IOException {
+    public static LingeredApp startApp(String... additionalJvmOpts) throws IOException {
         LingeredApp a = new LingeredApp();
         try {
-            startApp(a, cmd);
+            startApp(a, additionalJvmOpts);
         } catch (Exception ex) {
             System.err.println("LingeredApp failed to start: " + ex);
             a.finishApp();