summaryrefslogtreecommitdiffstats
path: root/test/etc
diff options
context:
space:
mode:
Diffstat (limited to 'test/etc')
-rwxr-xr-xtest/etc/run-test-jar11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 5c0f83f..2710df8 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -37,7 +37,8 @@ QUIET="n"
RELOCATE="y"
SECONDARY_DEX=""
TIME_OUT="y"
-TIME_OUT_VALUE=5m
+# Value in minutes.
+TIME_OUT_VALUE=5
USE_GDB="n"
USE_JVM="n"
VERIFY="y"
@@ -377,7 +378,13 @@ else
if [ "$TIME_OUT" = "y" ]; then
# Add timeout command if time out is desired.
- cmdline="timeout $TIME_OUT_VALUE $cmdline"
+ #
+ # Note: We use nested timeouts. The inner timeout sends SIGRTMIN+2 (usually 36) to ART, which
+ # will induce a full thread dump before abort. However, dumping threads might deadlock,
+ # so the outer timeout sends the regular SIGTERM after an additional minute to ensure
+ # termination (without dumping all threads).
+ TIME_PLUS_ONE=$(($TIME_OUT_VALUE + 1))
+ cmdline="timeout ${TIME_PLUS_ONE}m timeout -s SIGRTMIN+2 ${TIME_OUT_VALUE}m $cmdline"
fi
if [ "$DEV_MODE" = "y" ]; then