diff options
author | 2023-05-15 11:22:45 +0100 | |
---|---|---|
committer | 2023-05-16 08:55:59 +0000 | |
commit | 1d92d827f6b4ea6bde87b55bfb1715174f9069b3 (patch) | |
tree | 162f020aad1368ec2f5a25b9e4c3dffb56be0523 | |
parent | 41167f9bbd96c6ad2a63d7f0b7f2625771a5c247 (diff) |
Fix shadowed name in testrunner.py
The "env" in "env.ART_TEST_ON_VM" was shadowed,
and thus we got exception if timeout happened.
Test: ./art/test.py -b -r --host --optimizing
Change-Id: I7308716b00541ba773336f65ba241bfb18b411df
-rw-r--r-- | test/testrunner/env.py | 2 | ||||
-rwxr-xr-x | test/testrunner/testrunner.py | 21 |
2 files changed, 12 insertions, 11 deletions
diff --git a/test/testrunner/env.py b/test/testrunner/env.py index 44d0db67ec..200de4a97d 100644 --- a/test/testrunner/env.py +++ b/test/testrunner/env.py @@ -24,7 +24,7 @@ _VAR_CACHE_DIR = os.path.join(_TOP, "art/tools/build/") import sys sys.path.append(_VAR_CACHE_DIR) -import var_cache +import var_cache # type: ignore # end import var_cache.py _env = dict(os.environ) diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py index 4499ffd6e1..e730f5b5e4 100755 --- a/test/testrunner/testrunner.py +++ b/test/testrunner/testrunner.py @@ -81,6 +81,7 @@ import time import env from target_config import target_config from device_config import device_config +from typing import Dict, Set, List # TODO: make it adjustable per tests and for buildbots # @@ -105,13 +106,13 @@ DISABLED_TEST_CONTAINER = {} # The Dict contains the list of all possible variants for a given type. For example, # for key TARGET, the value would be target and host. The list is used to parse # the test name given as the argument to run. -VARIANT_TYPE_DICT = {} +VARIANT_TYPE_DICT: Dict[str, Set[str]] = {} # The set of all variant sets that are incompatible and will always be skipped. NONFUNCTIONAL_VARIANT_SETS = set() # The set contains all the variants of each time. -TOTAL_VARIANTS_SET = set() +TOTAL_VARIANTS_SET: Set[str] = set() # The colors are used in the output. When a test passes, COLOR_PASS is used, # and so on. @@ -143,19 +144,19 @@ gdb_dex2oat_args = '' csv_result = None csv_writer = None runtime_option = '' -with_agent = [] +with_agent: List[str] = [] zipapex_loc = None -run_test_option = [] +run_test_option: List[str] = [] dex2oat_jobs = -1 # -1 corresponds to default threads for dex2oat run_all_configs = False # Dict containing extra arguments -extra_arguments = { "host" : [], "target" : [] } +extra_arguments: Dict[str, List[str]] = { "host" : [], "target" : [] } # Dict to store user requested test variants. # key: variant_type. # value: set of variants user wants to run of type <key>. -_user_input_variants = collections.defaultdict(set) +_user_input_variants: collections.defaultdict = collections.defaultdict(set) class ChildProcessTracker(object): @@ -672,12 +673,12 @@ def run_test(command, test, test_variant, test_name): test_start_time = time.monotonic() if verbose: print_text("Starting %s at %s\n" % (test_name, test_start_time)) - env = dict(os.environ) - env["FULL_TEST_NAME"] = test_name + environ = dict(os.environ) + environ["FULL_TEST_NAME"] = test_name if gdb or gdb_dex2oat: proc = _popen( args=command.split(), - env=env, + env=environ, stderr=subprocess.STDOUT, universal_newlines=True, start_new_session=True @@ -685,7 +686,7 @@ def run_test(command, test, test_variant, test_name): else: proc = _popen( args=command.split(), - env=env, + env=environ, stderr=subprocess.STDOUT, stdout = subprocess.PIPE, universal_newlines=True, |