changeset 48183:45c5d7817e9e

8191933: Use failure handler in run-test Reviewed-by: erikj
author ihse
date Wed, 29 Nov 2017 22:23:21 +0100
parents 80a058c0f993
children 85ea7e83af30
files make/RunTests.gmk
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/make/RunTests.gmk	Wed Nov 29 12:39:59 2017 -0800
+++ b/make/RunTests.gmk	Wed Nov 29 22:23:21 2017 +0100
@@ -75,6 +75,18 @@
   JTREG_TOPDIR := $(CUSTOM_ROOT)
 endif
 
+JTREG_FAILURE_HANDLER_DIR := $(TEST_IMAGE_DIR)/failure_handler
+JTREG_FAILURE_HANDLER := $(JTREG_FAILURE_HANDLER_DIR)/jtregFailureHandler.jar
+
+ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
+  JTREG_FAILURE_HANDLER_OPTIONS := \
+      -timeoutHandlerDir:$(JTREG_FAILURE_HANDLER) \
+      -observerDir:$(JTREG_FAILURE_HANDLER) \
+      -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
+      -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
+      -timeoutHandlerTimeout:0
+endif
+
 ################################################################################
 # Parse control variables
 ################################################################################
@@ -472,6 +484,10 @@
     $1_JTREG_BASIC_OPTIONS += -cpa:$$(JIB_JAR)
   endif
 
+  ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
+    $1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
+  endif
+
   clean-workdir-$1:
 	$$(RM) -r $$($1_TEST_SUPPORT_DIR)
 
@@ -488,6 +504,7 @@
 	        -reportDir:$$($1_TEST_RESULTS_DIR) \
 	        -workDir:$$($1_TEST_SUPPORT_DIR) \
 	        $$(JTREG_OPTIONS) \
+	        $$(JTREG_FAILURE_HANDLER_OPTIONS) \
 	        $$($1_TEST_NAME) || true )
 
   $1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt