aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/python_utils/jobset.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests/python_utils/jobset.py')
-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