8191933: Use failure handler in run-test
authorihse
Wed, 29 Nov 2017 22:23:21 +0100
changeset 47986 45c5d7817e9e
parent 47985 80a058c0f993
child 47987 85ea7e83af30
child 55916 8cda3ed38148
8191933: Use failure handler in run-test Reviewed-by: erikj
make/RunTests.gmk
--- 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