commands.RunTestSuite: Give child process 10 min to clean up

This is especially important for GCE tests as the process launched by ctest
creates many GCP resources that should be released after test. Otherwise newer
tests will hit various quota issues quickly.

BUG=b:26489739
TEST=trybot

Change-Id: Ia50ed0849c01df349cc482b50cc84fb6fdde30f1
Reviewed-on: https://chromium-review.googlesource.com/324618
Commit-Ready: Daniel Wang <wonderfly@google.com>
Tested-by: Daniel Wang <wonderfly@google.com>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Andrey Ulanov <andreyu@google.com>
diff --git a/cbuildbot/commands.py b/cbuildbot/commands.py
index 0220d41..5491f86 100644
--- a/cbuildbot/commands.py
+++ b/cbuildbot/commands.py
@@ -666,7 +666,9 @@
   if ssh_private_key is not None:
     cmd.append('--ssh_private_key=%s' % ssh_private_key)
 
-  result = cros_build_lib.RunCommand(cmd, cwd=cwd, error_code_ok=True)
+  # Give tests 10 minutes to clean up before shutting down.
+  result = cros_build_lib.RunCommand(cmd, cwd=cwd, error_code_ok=True,
+                                     kill_timeout=10 * 60)
   if result.returncode:
     if os.path.exists(results_dir_in_chroot):
       error = '%s exited with code %d' % (' '.join(cmd), result.returncode)