diff --git a/.vpython b/.vpython index bbdc3023d41b7c..27ab9fad6132bc 100644 --- a/.vpython +++ b/.vpython @@ -21,6 +21,9 @@ # # Read more about `vpython` and how to modify this file here: # https://chromium.googlesource.com/infra/infra/+/master/doc/users/vpython.md +# +# For the definition of this spec, see: +# https://chromium.googlesource.com/infra/luci/luci-go/+/master/vpython/api/vpython/spec.proto python_version: "2.7" @@ -30,6 +33,19 @@ wheel: < name: "infra/python/wheels/jsonlines-py2_py3" version: "version:1.2.0" > +wheel: < + name: "infra/python/wheels/subprocess32/${vpython_platform}" + version: "version:3.5.0rc1" + # Only download for linux since we shouldn't be running CrOS tests on mac/win. + match_tag: < + abi: "cp27mu" + platform: "manylinux1_i686" + > + match_tag: < + abi: "cp27mu" + platform: "manylinux1_x86_64" + > +> # Used by: # build/chromeos/test_runner.py diff --git a/build/chromeos/test_runner.py b/build/chromeos/test_runner.py index 7296b4f3545e09..9777a45ed4b146 100755 --- a/build/chromeos/test_runner.py +++ b/build/chromeos/test_runner.py @@ -31,10 +31,7 @@ from pylib.base import base_test_result # pylint: disable=import-error from pylib.results import json_results # pylint: disable=import-error -# Use luci-py's subprocess42.py -sys.path.insert( - 0, os.path.join(CHROMIUM_SRC_PATH, 'tools', 'swarming_client', 'utils')) -import subprocess42 # pylint: disable=import-error +import subprocess32 as subprocess # pylint: disable=import-error DEFAULT_CROS_CACHE = os.path.abspath( os.path.join(CHROMIUM_SRC_PATH, 'build', 'cros_cache')) @@ -187,20 +184,20 @@ def _kill_child_procs(trapped_signal, _): logging.info('########################################') logging.info('Test attempt #%d', i) logging.info('########################################') - test_proc = subprocess42.Popen( + test_proc = subprocess.Popen( self._test_cmd, stdout=sys.stdout, stderr=sys.stderr, env=self._test_env) try: test_proc.wait(timeout=self._timeout) - except subprocess42.TimeoutExpired: + except subprocess.TimeoutExpired: logging.error('Test timed out. Sending SIGTERM.') # SIGTERM the proc and wait 10s for it to close. test_proc.terminate() try: test_proc.wait(timeout=10) - except subprocess42.TimeoutExpired: + except subprocess.TimeoutExpired: # If it hasn't closed in 10s, SIGKILL it. logging.error('Test did not exit in time. Sending SIGKILL.') test_proc.kill() @@ -710,7 +707,7 @@ def host_cmd(args, unknown_args): logging.info('Running the following command:') logging.info(' '.join(cros_run_test_cmd)) - return subprocess42.call( + return subprocess.call( cros_run_test_cmd, stdout=sys.stdout, stderr=sys.stderr, env=test_env)