From 590105ac53b3f211bcbfd88476590270d1499bf4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 19 Jan 2016 13:03:46 -0800 Subject: [PATCH] Eliminate jobset timeouts in some circumstances There are cases where we truly don't care how long something takes, and some external timeout will kill truly stuck processes, so let's eliminate timeouts in those cases --- tools/buildgen/generate_projects.py | 2 +- tools/run_tests/jobset.py | 4 +++- tools/run_tests/run_tests.py | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index 34437b9c8dd..c2d71747e9f 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -85,7 +85,7 @@ for template in templates: os.close(tf[0]) cmd.append(test[out]) cmd.append(root + '/' + f) - jobs.append(jobset.JobSpec(cmd, shortname=out)) + jobs.append(jobset.JobSpec(cmd, shortname=out, timeout_seconds=None)) jobset.run(jobs, maxjobs=multiprocessing.cpu_count()) diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index e33433daf2a..748c06dfbab 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -273,7 +273,9 @@ class Job(object): self.result.state = 'PASSED' if self._bin_hash: update_cache.finished(self._spec.identity(), self._bin_hash) - elif self._state == _RUNNING and time.time() - self._start > self._spec.timeout_seconds: + elif (self._state == _RUNNING and + self._spec.timeout_seconds is not None and + time.time() - self._start > self._spec.timeout_seconds): if self._timeout_retries < self._spec.timeout_retries: message('TIMEOUT_FLAKE', '%s [pid=%d]' % (self._spec.shortname, self._process.pid), stdout(), do_newline=True) self._timeout_retries += 1 diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 775bec94995..ccec948987f 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -764,7 +764,7 @@ if platform_string() == 'windows': _windows_toolset_option(args.compiler), _windows_arch_option(args.arch)] + extra_args, - shell=True, timeout_seconds=90*60) + shell=True, timeout_seconds=None) for target in targets] else: def make_jobspec(cfg, targets, makefile='Makefile'): @@ -776,7 +776,7 @@ else: 'CONFIG=%s' % cfg] + ([] if not args.travis else ['JENKINS_BUILD=1']) + targets, - timeout_seconds=30*60)] + timeout_seconds=None)] else: return [] make_targets = {} @@ -801,7 +801,7 @@ if make_targets: make_commands = itertools.chain.from_iterable(make_jobspec(cfg, list(targets), makefile) for cfg in build_configs for (makefile, targets) in make_targets.iteritems()) build_steps.extend(set(make_commands)) build_steps.extend(set( - jobset.JobSpec(cmdline, environ=build_step_environ(cfg), timeout_seconds=10*60) + jobset.JobSpec(cmdline, environ=build_step_environ(cfg), timeout_seconds=None) for cfg in build_configs for l in languages for cmdline in l.build_steps()))