Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request grpc#2757 from jtattermusch/runtest_polishing
Browse files Browse the repository at this point in the history
Runtest polishing
  • Loading branch information
ctiller committed Aug 4, 2015
2 parents 8956e60 + 725835a commit 8d453c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/run_tests/jobset.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def which(filename):
class JobSpec(object):
"""Specifies what to run for a job."""

def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None, cwd=None, shell=False):
def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None,
cwd=None, shell=False, timeout_seconds=900):
"""
Arguments:
cmdline: a list of arguments to pass as the command line
Expand All @@ -148,6 +149,7 @@ def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None, cwd
self.hash_targets = hash_targets or []
self.cwd = cwd
self.shell = shell
self.timeout_seconds = timeout_seconds

def identity(self):
return '%r %r %r' % (self.cmdline, self.environ, self.hash_targets)
Expand Down Expand Up @@ -206,7 +208,7 @@ def state(self, update_cache):
do_newline=self._newline_on_success or self._travis)
if self._bin_hash:
update_cache.finished(self._spec.identity(), self._bin_hash)
elif self._state == _RUNNING and time.time() - self._start > 900:
elif self._state == _RUNNING and time.time() - self._start > self._spec.timeout_seconds:
self._tempfile.seek(0)
stdout = self._tempfile.read()
filtered_stdout = filter(lambda x: x in string.printable, stdout.decode(errors='ignore'))
Expand Down

0 comments on commit 8d453c5

Please sign in to comment.