Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
b07ee506
Commit
b07ee506
authored
Feb 23, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code in time stamper thread and make sure the dup-ed stderr is closed in the end.
parent
2c0d0882
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
+31
-28
runtests.py
runtests.py
+31
-28
No files found.
runtests.py
View file @
b07ee506
...
@@ -2209,6 +2209,11 @@ def time_stamper_thread(interval=10):
...
@@ -2209,6 +2209,11 @@ def time_stamper_thread(interval=10):
Print
regular
time
stamps
into
the
build
logs
to
find
slow
tests
.
Print
regular
time
stamps
into
the
build
logs
to
find
slow
tests
.
@
param
interval
:
time
interval
in
seconds
@
param
interval
:
time
interval
in
seconds
"""
"""
if not interval or interval < 0:
# Do nothing
yield
return
try:
try:
_xrange = xrange
_xrange = xrange
except NameError:
except NameError:
...
@@ -2218,18 +2223,15 @@ def time_stamper_thread(interval=10):
...
@@ -2218,18 +2223,15 @@ def time_stamper_thread(interval=10):
import datetime
import datetime
from time import sleep
from time import sleep
if not interval or interval < 0:
# Do nothing
yield
else:
interval = _xrange(interval * 4)
interval = _xrange(interval * 4)
now = datetime.datetime.now
now = datetime.datetime.now
stop = False
stop = False
# We capture stderr in some places.
# We capture stderr in some places.
# => make sure we write to the real (original) stderr of the test runner.
# => make sure we write to the real (original) stderr of the test runner.
def write(s, stderr=os.dup(2)):
stderr = os.dup(2)
os.write(stderr, s if IS_PY2 else s.encode('ascii'))
def write(s):
os.write(stderr, s if type(s) is bytes else s.encode('ascii'))
def time_stamper():
def time_stamper():
while True:
while True:
...
@@ -2247,6 +2249,7 @@ def time_stamper_thread(interval=10):
...
@@ -2247,6 +2249,7 @@ def time_stamper_thread(interval=10):
finally:
finally:
stop = True
stop = True
thread.join()
thread.join()
os.close(stderr)
def configure_cython(options):
def configure_cython(options):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment