Increase timeout for libjdwp tests

Since libjdwp has more threads running concurrently then the old
internal jdwp implementation does it can sometimes take slightly
longer to finish certain test tasks (most notably shutdown). This was
causing the tests to timeout occasionally on the chrome-buildbots.

Bug: 68839405
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Change-Id: I8d443662c40de27d490248e8df5d77b43f78267c
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh
index f5fbcd8..6a846ae 100755
--- a/tools/run-jdwp-tests.sh
+++ b/tools/run-jdwp-tests.sh
@@ -96,6 +96,14 @@
     # We don't care about jit with the RI
     use_jit=false
     shift
+  elif [[ $1 == --test-timeout-ms ]]; then
+    # Remove the --test-timeout-ms from the arguments.
+    args=${args/$1}
+    shift
+    jdwp_test_timeout=$1
+    # Remove the argument
+    args=${args/$1}
+    shift
   elif [[ $1 == --agent-wrapper ]]; then
     # Remove the --agent-wrapper from the arguments.
     args=${args/$1}
diff --git a/tools/run-libjdwp-tests.sh b/tools/run-libjdwp-tests.sh
index 964bb38..47e7c45 100755
--- a/tools/run-libjdwp-tests.sh
+++ b/tools/run-libjdwp-tests.sh
@@ -29,11 +29,16 @@
 has_variant="no"
 has_mode="no"
 mode="target"
+has_timeout="no"
 
 while true; do
   if [[ $1 == "--debug" ]]; then
     debug="yes"
     shift
+  elif [[ $1 == --test-timeout-ms ]]; then
+    has_timeout="yes"
+    shift
+    shift
   elif [[ "$1" == "--mode=jvm" ]]; then
     has_mode="yes"
     mode="ri"
@@ -60,6 +65,12 @@
   args+=(--variant=X32)
 fi
 
+if [[ "$has_timeout" = "no" ]]; then
+  # Double the timeout to 20 seconds
+  args+=(--test-timeout-ms)
+  args+=(20000)
+fi
+
 # We don't use full paths since it is difficult to determine them for device
 # tests and not needed due to resolution rules of dlopen.
 if [[ "$debug" = "yes" ]]; then