# HG changeset patch # User jwilhelm # Date 1478701959 -3600 # Node ID 94bbcefde876a9861e3d5b68349f899cbe85cc81 # Parent 3ee4e7827413fa5c5c4fca58597b0ad89e921bfb# Parent 13940eebb34fc738c038a4b5d930a1f9089f1103 Merge diff -r 3ee4e7827413 -r 94bbcefde876 make/jprt.properties --- a/make/jprt.properties Wed Jul 05 22:27:20 2017 +0200 +++ b/make/jprt.properties Wed Nov 09 15:32:39 2016 +0100 @@ -334,11 +334,7 @@ solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98, \ solaris_sparcv9_5.11-{product|fastdebug}-c2-jvm98_nontiered, \ solaris_sparcv9_5.11-{product|fastdebug}-c2-scimark, \ - solaris_sparcv9_5.11-product-c2-runThese8, \ - solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_SerialGC, \ - solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_CMS, \ - solaris_sparcv9_5.11-{product|fastdebug}-c2-GCBasher_G1 + solaris_sparcv9_5.11-product-c2-runThese8, my.test.targets.hotspot.solaris.x64= \ solaris_x64_5.11-{product|fastdebug}-c2-jvm98, \ @@ -346,40 +342,24 @@ solaris_x64_5.11-{product|fastdebug}-c2-scimark, \ solaris_x64_5.11-product-c2-runThese8, \ solaris_x64_5.11-product-c2-runThese8_Xcomp_lang, \ - solaris_x64_5.11-product-c2-runThese8_Xcomp_vm, \ - solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_SerialGC, \ - solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_CMS, \ - solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_G1 + solaris_x64_5.11-product-c2-runThese8_Xcomp_vm, my.test.targets.hotspot.linux.i586= \ linux_i586_3.8-{product|fastdebug}-c2-jvm98, \ linux_i586_3.8-{product|fastdebug}-c2-jvm98_nontiered, \ linux_i586_3.8-{product|fastdebug}-c2-scimark, \ linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_lang, \ - linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm, \ - linux_i586_3.8-{product|fastdebug}-c2-GCBasher_SerialGC, \ - linux_i586_3.8-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - linux_i586_3.8-{product|fastdebug}-c2-GCBasher_CMS, \ - linux_i586_3.8-{product|fastdebug}-c2-GCBasher_G1 + linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm my.test.targets.hotspot.linux.x64= \ linux_x64_3.8-{product|fastdebug}-c2-jvm98, \ linux_x64_3.8-{product|fastdebug}-c2-jvm98_nontiered, \ - linux_x64_3.8-{product|fastdebug}-c2-scimark, \ - linux_x64_3.8-{product|fastdebug}-c2-GCBasher_SerialGC, \ - linux_x64_3.8-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - linux_x64_3.8-{product|fastdebug}-c2-GCBasher_CMS, \ - linux_x64_3.8-{product|fastdebug}-c2-GCBasher_G1 + linux_x64_3.8-{product|fastdebug}-c2-scimark my.test.targets.hotspot.macosx.x64= \ macosx_x64_10.9-{product|fastdebug}-c2-jvm98, \ macosx_x64_10.9-{product|fastdebug}-c2-jvm98_nontiered, \ - macosx_x64_10.9-{product|fastdebug}-c2-scimark, \ - macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_SerialGC, \ - macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_CMS, \ - macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_G1 + macosx_x64_10.9-{product|fastdebug}-c2-scimark my.test.targets.hotspot.windows.i586= \ windows_i586_6.3-{product|fastdebug}-c2-jvm98, \ @@ -387,11 +367,7 @@ windows_i586_6.3-{product|fastdebug}-c2-scimark, \ windows_i586_6.3-product-c2-runThese8, \ windows_i586_6.3-product-c2-runThese8_Xcomp_lang, \ - windows_i586_6.3-product-c2-runThese8_Xcomp_vm, \ - windows_i586_6.3-{product|fastdebug}-c2-GCBasher_SerialGC, \ - windows_i586_6.3-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - windows_i586_6.3-{product|fastdebug}-c2-GCBasher_CMS, \ - windows_i586_6.3-{product|fastdebug}-c2-GCBasher_G1 + windows_i586_6.3-product-c2-runThese8_Xcomp_vm, my.test.targets.hotspot.windows.x64= \ windows_x64_6.3-{product|fastdebug}-c2-jvm98, \ @@ -399,11 +375,7 @@ windows_x64_6.3-{product|fastdebug}-c2-scimark, \ windows_x64_6.3-product-c2-runThese8, \ windows_x64_6.3-product-c2-runThese8_Xcomp_lang, \ - windows_x64_6.3-product-c2-runThese8_Xcomp_vm, \ - windows_x64_6.3-{product|fastdebug}-c2-GCBasher_SerialGC, \ - windows_x64_6.3-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - windows_x64_6.3-{product|fastdebug}-c2-GCBasher_CMS, \ - windows_x64_6.3-{product|fastdebug}-c2-GCBasher_G1 + windows_x64_6.3-product-c2-runThese8_Xcomp_vm, # Some basic "smoke" tests for OpenJDK builds my.test.targets.hotspot.open= \ @@ -468,9 +440,17 @@ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_2}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_closed}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcold}, \ + ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcbasher}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_runtime}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_serviceability}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity}, \ + solaris_sparcv9_5.11-product-c2-hotspot_fast_gc_gcbasher, \ + solaris_x64_5.11-product-c2-hotspot_fast_gc_gcbasher, \ + linux_i586_3.8-product-c2-hotspot_fast_gc_gcbasher, \ + linux_x64_3.8-product-c2-hotspot_fast_gc_gcbasher, \ + macosx_x64_10.9-product-c2-hotspot_fast_gc_gcbasher, \ + windows_i586_6.3-product-c2-hotspot_fast_gc_gcbasher, \ + windows_x64_6.3-product-c2-hotspot_fast_gc_gcbasher, \ ${my.additional.make.rule.test.targets.hotspot.reg} # Other Makefile based Hotspot tests diff -r 3ee4e7827413 -r 94bbcefde876 test/failure_handler/Makefile --- a/test/failure_handler/Makefile Wed Jul 05 22:27:20 2017 +0200 +++ b/test/failure_handler/Makefile Wed Nov 09 15:32:39 2016 +0100 @@ -86,7 +86,7 @@ test: require_env build rm -rf "${RUN_DIR}" mkdir -p "${RUN_DIR}" - "${JTREG_HOME}"/bin/jtreg \ + "${JTREG_HOME}"/bin/jtreg \ -jdk:"${JAVA_HOME}" \ ${JTREG_TEST_OPTS} \ -timeout:0.1 -va -retain:all \ @@ -94,6 +94,7 @@ -agentvm \ -thd:"${TARGET_JAR}" \ -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ + -thtimeout:0 \ -od:"${TARGET_JAR}" \ -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ -w:"${RUN_DIR}/JTwork" \ diff -r 3ee4e7827413 -r 94bbcefde876 test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java --- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java Wed Jul 05 22:27:20 2017 +0200 +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java Wed Nov 09 15:32:39 2016 +0100 @@ -49,7 +49,7 @@ private HtmlSection(PrintWriter pw, String id, String name, HtmlSection rootSection) { this.pw = pw; - textWriter = new PrintWriter(new HtmlFilterWriter(pw)); + textWriter = new PrintWriter(new HtmlFilterWriter(pw), true); this.id = id; this.name = name; child = null; diff -r 3ee4e7827413 -r 94bbcefde876 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java --- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java Wed Jul 05 22:27:20 2017 +0200 +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java Wed Nov 09 15:32:39 2016 +0100 @@ -164,7 +164,8 @@ Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); - log.printf("%s%n[%tF % storedAppOutput; - private final String lockFileName; - private long lockCreationTime; - private Process appProcess; - private final ArrayList storedAppOutput; + protected Process appProcess; + protected static final int appWaitTime = 100; + protected final String lockFileName; /* * Drain child process output, store it into string array @@ -255,14 +256,10 @@ } /** - * Run the app - * - * @param vmArguments - * @throws IOException + * Analyze an environment and prepare a command line to + * run the app, app name should be added explicitly */ - public void runApp(List vmArguments) - throws IOException { - + public List runAppPrepare(List 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,28 +300,52 @@ String classpath = System.getProperty("test.class.path"); cmd.add((classpath == null) ? "." : classpath); - cmd.add(this.getAppName()); - cmd.add(lockFileName); + return cmd; + } - // Reporting + /** + * Assemble command line to a printable string + */ + public void printCommandLine(List cmd) { + // A bit of verbosity StringBuilder cmdLine = new StringBuilder(); for (String strCmd : cmd) { cmdLine.append("'").append(strCmd).append("' "); } - // A bit of verbosity System.out.println("Command line: [" + cmdLine.toString() + "]"); + } + + public void startGobblerPipe() { + // Create pipe reader for process, and read stdin and stderr to array of strings + InputGobbler gb = new InputGobbler(appProcess.getInputStream(), storedAppOutput); + gb.start(); + } + + /** + * Run the app. + * + * @param vmArguments + * @throws IOException + */ + public void runApp(List vmArguments) + throws IOException { + + List cmd = runAppPrepare(vmArguments); + + cmd.add(this.getAppName()); + cmd.add(lockFileName); + + printCommandLine(cmd); ProcessBuilder pb = new ProcessBuilder(cmd); // we don't expect any error output but make sure we are not stuck on pipe // pb.redirectErrorStream(false); + // ProcessBuilder.start can throw IOException pb.redirectError(ProcessBuilder.Redirect.INHERIT); - appProcess = pb.start(); - // Create pipe reader for process, and read stdin and stderr to array of strings - InputGobbler gb = new InputGobbler(appProcess.getInputStream(), storedAppOutput); - gb.start(); + startGobblerPipe(); } /** @@ -334,10 +355,14 @@ */ public void stopApp() throws IOException { deleteLock(); - waitAppTerminate(); - int exitcode = appProcess.exitValue(); - if (exitcode != 0) { - throw new IOException("LingeredApp terminated with non-zero exit code " + exitcode); + // The startApp() of the derived app can throw + // an exception before the LA actually starts + if (appProcess != null) { + waitAppTerminate(); + int exitcode = appProcess.exitValue(); + if (exitcode != 0) { + throw new IOException("LingeredApp terminated with non-zero exit code " + exitcode); + } } }