diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 0c9b71edab..7d0e795035 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -10,6 +10,7 @@ details on the presubmit API built into depot_tools. import fnmatch import os +import sys # CIPD ensure manifest for checking CIPD client itself. @@ -24,6 +25,13 @@ $VerifiedPlatform linux-mips64 linux-mips64le linux-mipsle %s %s ''' +# Timeout for a test to be executed. +TEST_TIMEOUT_S = 180 # 3m +# Tests take longer on Windows. +if sys.platform.startswith('win'): + TEST_TIMEOUT_S = 330 # 5m 30s + + def DepotToolsPylint(input_api, output_api): """Gather all the pylint logic into one place to make it self-contained.""" @@ -57,6 +65,8 @@ def DepotToolsPylint(input_api, output_api): def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3): + input_api.SetTimeout(TEST_TIMEOUT_S) + results = [] results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) results.extend(input_api.canned_checks.CheckOwnersFormat(