Commit 595eb191 authored by Edward Lemur's avatar Edward Lemur Committed by LUCI CQ

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/+/2098942Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 3c117949
...@@ -10,6 +10,7 @@ details on the presubmit API built into depot_tools. ...@@ -10,6 +10,7 @@ details on the presubmit API built into depot_tools.
import fnmatch import fnmatch
import os import os
import sys
# CIPD ensure manifest for checking CIPD client itself. # CIPD ensure manifest for checking CIPD client itself.
...@@ -24,6 +25,13 @@ $VerifiedPlatform linux-mips64 linux-mips64le linux-mipsle ...@@ -24,6 +25,13 @@ $VerifiedPlatform linux-mips64 linux-mips64le linux-mipsle
%s %s %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): def DepotToolsPylint(input_api, output_api):
"""Gather all the pylint logic into one place to make it self-contained.""" """Gather all the pylint logic into one place to make it self-contained."""
...@@ -57,6 +65,8 @@ def DepotToolsPylint(input_api, output_api): ...@@ -57,6 +65,8 @@ def DepotToolsPylint(input_api, output_api):
def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3): def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3):
input_api.SetTimeout(TEST_TIMEOUT_S)
results = [] results = []
results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) results.extend(input_api.canned_checks.CheckOwners(input_api, output_api))
results.extend(input_api.canned_checks.CheckOwnersFormat( results.extend(input_api.canned_checks.CheckOwnersFormat(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment