aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-11-04 16:39:54 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-11-04 16:39:54 -0800
commit60078bb26de847265e45f0687ae374ef3bcedd6d (patch)
tree76853ec6c79753ed69703e93de829ef1a618b269
parent10cb14c87e10e8f248d65511578ea78736e5c613 (diff)
Potential fix for failing to start binaries on mac
-rwxr-xr-xtools/run_tests/jobset.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 0c4d1b8143..88d95027e2 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -203,12 +203,23 @@ class Job(object):
env.update(self._spec.environ)
env.update(self._add_env)
self._start = time.time()
- self._process = subprocess.Popen(args=self._spec.cmdline,
- stderr=subprocess.STDOUT,
- stdout=self._tempfile,
- cwd=self._spec.cwd,
- shell=self._spec.shell,
- env=env)
+ try_start = lambda: subprocess.Popen(args=self._spec.cmdline,
+ stderr=subprocess.STDOUT,
+ stdout=self._tempfile,
+ cwd=self._spec.cwd,
+ shell=self._spec.shell,
+ env=env)
+ delay = 0.3
+ for i in range(0, 4):
+ try:
+ self._process = try_start()
+ break
+ except OSError:
+ message('WARNING', 'Failed to start %s, retrying in %f seconds' % (self._spec.shortname, delay))
+ time.sleep(delay)
+ delay *= 2
+ else:
+ self._process = try_start()
self._state = _RUNNING
def state(self, update_cache):