Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
63768a94
Commit
63768a94
authored
May 12, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__benchmarks.py: do not create shell, use unbuffered python, make sure subprocess is killed
parent
a9ffb413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
greentest/test__benchmarks.py
greentest/test__benchmarks.py
+31
-14
No files found.
greentest/test__benchmarks.py
View file @
63768a94
import
sys
import
glob
import
mysubprocess
as
subprocess
import
subprocess
import
time
TIMEOUT
=
10
TIMEOUT
=
30
def
kill
(
popen
):
if
popen
.
poll
()
is
not
None
:
return
try
:
popen
.
kill
()
except
OSError
,
ex
:
if
ex
.
errno
==
3
:
# No such process
return
if
ex
.
errno
==
13
:
# Permission denied (translated from windows error 5: "Access is denied")
return
raise
def
wait
(
popen
):
end
=
time
.
time
()
+
TIMEOUT
while
popen
.
poll
()
is
None
:
if
time
.
time
()
>
end
:
kill
(
popen
)
popen
.
wait
()
return
'TIMEOUT'
time
.
sleep
(
0.1
)
return
popen
.
poll
()
def
system
(
command
):
p
=
subprocess
.
Popen
(
command
,
shell
=
Tru
e
)
p
open
=
subprocess
.
Popen
(
command
,
shell
=
Fals
e
)
try
:
start
=
time
.
time
()
while
time
.
time
()
<
start
+
TIMEOUT
and
p
.
poll
()
is
None
:
time
.
sleep
(
0.1
)
if
p
.
poll
()
is
None
:
p
.
kill
()
return
'KILLED'
return
p
.
poll
()
return
wait
(
popen
)
finally
:
if
p
.
poll
()
is
None
:
p
.
kill
()
kill
(
popen
)
modules
=
set
()
...
...
@@ -35,10 +52,10 @@ if __name__ == '__main__':
for
path
in
modules
:
sys
.
stderr
.
write
(
path
+
'
\
n
'
)
sys
.
stdout
.
flush
()
command
=
'%s %s all'
%
(
sys
.
executable
,
path
)
command
=
[
sys
.
executable
,
'-u'
,
path
,
'all'
]
res
=
system
(
command
)
if
res
:
error
=
'%r failed with
code %s'
%
(
command
,
res
)
error
=
'%r failed with
%s'
%
(
' '
.
join
(
command
)
,
res
)
sys
.
stderr
.
write
(
error
+
'
\
n
'
)
errors
.
append
(
error
)
sys
.
stderr
.
write
(
'-----
\
n
\
n
'
)
...
...
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