< prev index next >

test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -239,12 +239,11 @@
         javaFlags.add("-Djava.awt.headless=true");
         javaFlags.add("-esa");
         javaFlags.add("-ea");
         // Make sure exception message is never null
         javaFlags.add("-XX:-OmitStackTraceInFastThrow");
-        // set timeout factor based on jtreg harness settings
-        javaFlags.add("-Dgraaltest.timeout.factor=" + System.getProperty("test.timeout.factor", "1.0"));
+
 
         // generate class path
         ArrayList<String> graalJars = new ArrayList<String>(Arrays.asList(GRAAL_EXTRA_JARS));
         graalJars.add(MXTOOL_JARFILE);
         graalJars.add(GRAAL_UNITTESTS_JARFILE);

@@ -252,15 +251,11 @@
         String graalJarsCP = graalJars.stream()
                                       .map(s -> String.join(File.separator, libsDir, s))
                                       .collect(Collectors.joining(File.pathSeparator));
 
         javaFlags.add("-cp");
-        // Existing classpath returned by System.getProperty("java.class.path") may contain another
-        // version of junit with which the jtreg tool is built. It may be incompatible with required
-        // junit version. So we put graalJarsCP before existing classpath when generating a new one
-        // to avoid incompatibility issues.
-        javaFlags.add(String.join(File.pathSeparator, graalJarsCP, System.getProperty("java.class.path")));
+        javaFlags.add(String.join(File.pathSeparator, System.getProperty("java.class.path"), graalJarsCP));
 
         //
         javaFlags.add("com.oracle.mxtool.junit.MxJUnitWrapper");
         javaFlags.add("-JUnitVerbose");
         javaFlags.add("-JUnitEagerStackTrace");

@@ -272,11 +267,12 @@
                 javaFlags.toArray(new String[javaFlags.size()]));
 
         // Some tests rely on MX_SUBPROCESS_COMMAND_FILE env variable which contains
         // name of the file with java executable and java args used to launch the current process.
         Path cmdFile = Files.createTempFile(Path.of(""), "mx_subprocess_", ".cmd");
-        Files.write(cmdFile, javaPB.command());
+        Files.writeString(cmdFile, JDKToolFinder.getJDKTool("java") + System.lineSeparator());
+        Files.write(cmdFile, javaFlags, StandardOpenOption.APPEND);
         javaPB.environment().put("MX_SUBPROCESS_COMMAND_FILE", cmdFile.toAbsolutePath().toString());
 
         System.out.println("INFO: run command: " + String.join(" ", javaPB.command()));
 
         OutputAnalyzer outputAnalyzer = new OutputAnalyzer(javaPB.start());
< prev index next >