aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/python_utils
diff options
context:
space:
mode:
authorGravatar Matt Kwong <matt-kwong@users.noreply.github.com>2017-07-11 15:32:19 -0700
committerGravatar GitHub <noreply@github.com>2017-07-11 15:32:19 -0700
commit9a836ca37bcbc63c0cdf1ae8dbbfa43a85f7513f (patch)
tree74062402fde484e7b3c6eaca884f5dcd5e762226 /tools/run_tests/python_utils
parent72cdf6f08242251810edae2df0b3f261afc73c2e (diff)
parentc15d32bbe89a2bf950992ded06d1b3da7f1f39a6 (diff)
Merge pull request #11670 from matt-kwong/perf_alarm
Don't clear alarm in jobset when running performance tests
Diffstat (limited to 'tools/run_tests/python_utils')
-rwxr-xr-xtools/run_tests/python_utils/jobset.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/run_tests/python_utils/jobset.py b/tools/run_tests/python_utils/jobset.py
index 044c6f3aa4..08d652ae3f 100755
--- a/tools/run_tests/python_utils/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -367,9 +367,10 @@ class Jobset(object):
"""Manages one run of jobs."""
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis,
- stop_on_failure, add_env, quiet_success, max_time):
+ stop_on_failure, add_env, quiet_success, max_time, clear_alarms):
self._running = set()
self._check_cancelled = check_cancelled
+ self._clear_alarms = clear_alarms
self._cancelled = False
self._failures = 0
self._completed = 0
@@ -473,7 +474,10 @@ class Jobset(object):
while self._running:
if self.cancelled(): pass # poll cancellation
self.reap()
- if platform_string() != 'windows':
+ # Clear the alarms when finished to avoid a race condition causing job
+ # failures. Don't do this when running multi-VM tests because clearing
+ # the alarms causes the test to stall
+ if platform_string() != 'windows' and self._clear_alarms:
signal.alarm(0)
return not self.cancelled() and self._failures == 0
@@ -503,7 +507,8 @@ def run(cmdlines,
add_env={},
skip_jobs=False,
quiet_success=False,
- max_time=-1):
+ max_time=-1,
+ clear_alarms=True):
if skip_jobs:
resultset = {}
skipped_job_result = JobResult()
@@ -515,7 +520,7 @@ def run(cmdlines,
js = Jobset(check_cancelled,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
newline_on_success, travis, stop_on_failure, add_env,
- quiet_success, max_time)
+ quiet_success, max_time, clear_alarms)
for cmdline, remaining in tag_remaining(cmdlines):
if not js.start(cmdline):
break