Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
edfd1023
Commit
edfd1023
authored
10 years ago
by
Nicolas Noble
Browse files
Options
Downloads
Plain Diff
Merge pull request #850 from ctiller/run-tests-timer
Add timer to run_tests.py
parents
10682b75
b84728d6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/run_tests/jobset.py
+9
-4
9 additions, 4 deletions
tools/run_tests/jobset.py
with
9 additions
and
4 deletions
tools/run_tests/jobset.py
+
9
−
4
View file @
edfd1023
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment