ART: Use SIGTERM for timeout dumping

Switch to using SIGTERM (15), the timeout default.

Bug: 134837513
Test: m test-art-host
Test: manual (change timeout)
Change-Id: Ic962d0a59c1636dffe742a2cbea06099ab567791
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index a158a4b..1a5e4fd 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -571,7 +571,7 @@
 ifeq (,$(SANITIZE_HOST))
 $$(gtest_output): $$(gtest_exe) $$(gtest_deps)
 	$(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && \
-		timeout --foreground -k 120s -s SIGRTMIN+2 2400s $(HOST_OUT_EXECUTABLES)/signal_dumper \
+		timeout --foreground -k 120s 2400s $(HOST_OUT_EXECUTABLES)/signal_dumper -s 15 \
 			$$< --gtest_output=xml:$$@ && \
 		$$(call ART_TEST_PASSED,$$(NAME))) || $$(call ART_TEST_FAILED,$$(NAME))
 else
@@ -584,8 +584,8 @@
 # under ASAN.
 $$(gtest_output): $$(gtest_exe) $$(gtest_deps)
 	$(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && set -o pipefail && \
-		ASAN_OPTIONS=detect_leaks=1 timeout --foreground -k 120s -s SIGRTMIN+2 3600s \
-			$(HOST_OUT_EXECUTABLES)/signal_dumper \
+		ASAN_OPTIONS=detect_leaks=1 timeout --foreground -k 120s 3600s \
+			$(HOST_OUT_EXECUTABLES)/signal_dumper -s 15 \
 				$$< --gtest_output=xml:$$@ 2>&1 | tee $$<.tmp.out >&2 && \
 		{ $$(call ART_TEST_PASSED,$$(NAME)) ; rm $$<.tmp.out ; }) || \
 		( grep -q AddressSanitizer $$<.tmp.out && export ANDROID_BUILD_TOP=`pwd` && \
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index ab7621a..85e41c3 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -1105,11 +1105,12 @@
     if [ "$TIME_OUT" = "timeout" ]; then
       # Add timeout command if time out is desired.
       #
-      # Note: We first send SIGRTMIN+2 (usually 36) to ART, which will induce a full thread dump
-      #       before abort. However, dumping threads might deadlock, so we also use the "-k"
-      #       option to definitely kill the child.
+      # Note: We first send SIGTERM (the timeout default, signal 15) to the signal dumper, which
+      #       will induce a full thread dump before killing the process. To ensure any issues in
+      #       dumping do not lead to a deadlock, we also use the "-k" option to definitely kill the
+      #       child.
       # Note: Using "--foreground" to not propagate the signal to children, i.e., the runtime.
-      cmdline="timeout --foreground -k 120s -s SIGRTMIN+2 ${TIME_OUT_VALUE}s ${TIMEOUT_DUMPER} $cmdline"
+      cmdline="timeout --foreground -k 120s ${TIME_OUT_VALUE}s ${TIMEOUT_DUMPER} -s 15 $cmdline"
     fi
 
     if [ "$DEV_MODE" = "y" ]; then