aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-02-26 15:53:30 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-02-26 15:53:30 -0800
commit8d813da1fb55adeb80f99d25068d9a9c5334617a (patch)
tree3f1f537168dfe5781ca1d87e5ca050aee78a8fb0
parentdcf8cee71285b0abee3b6c37886d84a4f8394636 (diff)
parentb84728d6dd568b9e0104376d8232cea89c5a6052 (diff)
Merge branch 'run-tests-timer' into travis-c
-rwxr-xr-xtools/run_tests/jobset.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 575d2c5902..7e1faa7b94 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -161,6 +161,7 @@ class Job(object):
env = os.environ.copy()
for k, v in spec.environ.iteritems():
env[k] = v
+ self._start = time.time()
self._process = subprocess.Popen(args=spec.cmdline,
stderr=subprocess.STDOUT,
stdout=self._tempfile,
@@ -168,12 +169,12 @@ class Job(object):
self._state = _RUNNING
self._newline_on_success = newline_on_success
self._travis = travis
- if not travis:
- message('START', spec.shortname)
+ message('START', spec.shortname, do_newline=self._travis)
def state(self, update_cache):
"""Poll current state of the job. Prints messages at completion."""
if self._state == _RUNNING and self._process.poll() is not None:
+ elapsed = time.time() - self._start
if self._process.returncode != 0:
self._state = _FAILURE
self._tempfile.seek(0)
@@ -182,7 +183,7 @@ class Job(object):
self._spec.shortname, self._process.returncode), stdout)
else:
self._state = _SUCCESS
- message('PASSED', self._spec.shortname,
+ message('PASSED', '%s [time=%.1fsec]' % (self._spec.shortname, elapsed),
do_newline=self._newline_on_success or self._travis)
if self._bin_hash:
update_cache.finished(self._spec.identity(), self._bin_hash)
@@ -288,7 +289,11 @@ def run(cmdlines,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
newline_on_success, travis,
cache if cache is not None else NoCache())
- for cmdline in shuffle_iteratable(cmdlines):
+ if not travis:
+ cmdlines = shuffle_iteratable(cmdlines)
+ else:
+ cmdlines = sorted(cmdlines)
+ for cmdline in cmdlines:
if not js.start(cmdline):
break
return js.finish()