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
b36f9d3e
Commit
b36f9d3e
authored
Apr 28, 2014
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testrunner.py: run some tests one at a time
parent
564a7fa6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
greentest/testrunner.py
greentest/testrunner.py
+24
-12
No files found.
greentest/testrunner.py
View file @
b36f9d3e
...
...
@@ -17,6 +17,13 @@ TIMEOUT = 180
NWORKERS
=
int
(
os
.
environ
.
get
(
'NWORKERS'
)
or
4
)
# tests that don't do well when run on busy box
RUN_ALONE
=
[
'test__threadpool.py'
,
'test__examples.py'
]
def
run_many
(
tests
,
expected
=
None
,
failfast
=
False
):
global
NWORKERS
start
=
time
.
time
()
...
...
@@ -64,13 +71,23 @@ def run_many(tests, expected=None, failfast=False):
else
:
time
.
sleep
(
0.1
)
run_alone
=
[]
try
:
try
:
for
cmd
,
options
in
tests
:
total
+=
1
spawn
((
cmd
,
),
options
or
{})
options
=
options
or
{}
if
matches
(
RUN_ALONE
,
cmd
):
run_alone
.
append
((
cmd
,
options
))
else
:
spawn
((
cmd
,
),
options
)
pool
.
close
()
pool
.
join
()
for
cmd
,
options
in
run_alone
:
run_one
(
cmd
,
**
options
)
except
KeyboardInterrupt
:
try
:
log
(
'Waiting for currently running to finish...'
)
...
...
@@ -131,16 +148,11 @@ def load_list_from_file(filename):
return
result
def
might_fail
(
expected
,
command
):
for
line
in
expected
:
if
command
.
endswith
(
' '
+
line
.
replace
(
'FLAKY '
,
''
)):
return
True
return
False
def
must_fail
(
expected
,
command
):
def
matches
(
expected
,
command
,
include_flaky
=
True
):
if
isinstance
(
command
,
list
):
command
=
' '
.
join
(
command
)
for
line
in
expected
:
if
'FLAKY'
in
line
:
if
not
include_flaky
and
line
.
startswith
(
'FLAKY '
)
:
continue
if
command
.
endswith
(
' '
+
line
.
replace
(
'FLAKY '
,
''
)):
return
True
...
...
@@ -175,7 +187,7 @@ def report(total, failed, passed, exit=True, took=None, expected=None):
passed_unexpected
=
[]
for
name
in
passed
:
if
m
ust_fail
(
expected
,
nam
e
):
if
m
atches
(
expected
,
name
,
include_flaky
=
Fals
e
):
passed_unexpected
.
append
(
name
)
if
passed_unexpected
:
...
...
@@ -186,7 +198,7 @@ def report(total, failed, passed, exit=True, took=None, expected=None):
log
(
'
\
n
%s/%s tests failed%s'
,
len
(
failed
),
total
,
took
)
expected
=
set
(
expected
or
[])
for
name
in
failed
:
if
m
ight_fail
(
expected
,
nam
e
):
if
m
atches
(
expected
,
name
,
include_flaky
=
Tru
e
):
failed_expected
.
append
(
name
)
else
:
failed_unexpected
.
append
(
name
)
...
...
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