ART: Add env variable to increase run-test timeouts

To generally increase timeouts, allow an environmental factor. This
is meant for slow hosts or devices.

We may want to look into trying to auto-detect the necessity of this.

Bug: 140935398
Test: ART_TIME_OUT_MULTIPLIER=10 art/test/run-test --host --dev 001-HelloWorld
Change-Id: I3f751b5e824da52e6441691b944eb99c1c3692b3
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 75b29d1..750735d 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -460,6 +460,11 @@
   fi
 fi
 
+# Escape hatch for slow hosts or devices. Accept an environment variable as a timeout factor.
+if [ ! -z "$ART_TIME_OUT_MULTIPLIER" ] ; then
+  TIME_OUT_VALUE=$((${TIME_OUT_VALUE} * ${ART_TIME_OUT_MULTIPLIER}))
+fi
+
 # The DEX_LOCATION with the chroot prefix, if any.
 CHROOT_DEX_LOCATION="$CHROOT$DEX_LOCATION"