PRESUBMIT.py: Add timeout to tests.

Interrupt tests after 3 min, so that failures can be
surfaced before the presubmit step gets interrupted
on the bot.

Change-Id: Ia0efebaac5a0c5072b974a4fbbcb14fe672017ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2098942
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/42/2098942/5
Edward Lemur 5 years ago committed by LUCI CQ
parent 3c11794956
commit 595eb19165

@ -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(

Loading…
Cancel
Save