From 0780382f34e2e2f78a7a5a09051da8893ed8c828 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Wed, 29 Nov 2017 22:23:21 +0100 Subject: [PATCH] 8191933: Use failure handler in run-test Reviewed-by: erikj --- make/RunTests.gmk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/make/RunTests.gmk b/make/RunTests.gmk index 50aaae6bf55..cdf93adceda 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -75,6 +75,18 @@ else 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 @@ define SetupRunJtregTestBody $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 @@ define SetupRunJtregTestBody -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