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
948aa7d1
Commit
948aa7d1
authored
Jan 10, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More flaky test markers
parent
9b73bfab
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
src/greentest/2.7pypy/lock_tests.py
src/greentest/2.7pypy/lock_tests.py
+6
-1
src/greentest/greentest.py
src/greentest/greentest.py
+10
-4
src/greentest/test__pool.py
src/greentest/test__pool.py
+2
-4
src/greentest/test__threadpool.py
src/greentest/test__threadpool.py
+4
-1
No files found.
src/greentest/2.7pypy/lock_tests.py
View file @
948aa7d1
...
...
@@ -295,7 +295,12 @@ class EventTests(BaseTestCase):
self
.
assertEqual
(
results1
,
[
False
]
*
N
)
for
r
,
dt
in
results2
:
self
.
assertFalse
(
r
)
self
.
assertTrue
(
dt
>=
0.2
,
dt
)
#self.assertTrue(dt >= 0.2, dt)
# gevent: With libuv, timers are slightly variable
# (and coalesce?). Sometimes the sleep is
# 0.00004 less than expected, e.g., 0.199996
self
.
assertTrue
(
dt
>=
0.18
,
dt
)
# The event is set
results1
=
[]
results2
=
[]
...
...
src/greentest/greentest.py
View file @
948aa7d1
...
...
@@ -192,8 +192,15 @@ class FlakyTestTimeout(FlakyTest):
unexpected timeout.
"""
def
reraiseFlakyTestRaceCondition
():
six
.
reraise
(
*
sys
.
exc_info
())
reraiseFlakyTestTimeout
=
reraiseFlakyTestRaceCondition
reraiseFlakyTestRaceConditionLibuv
=
reraiseFlakyTestRaceCondition
reraiseFlakyTestTimeoutLibuv
=
reraiseFlakyTestRaceCondition
if
RUNNING_ON_CI
:
# pylint: disable=function-redefined
def
reraiseFlakyTestRaceCondition
():
six
.
reraise
(
FlakyTestRaceCondition
,
FlakyTestRaceCondition
(
'
\
n
'
.
join
(
dump_stacks
())),
...
...
@@ -204,11 +211,10 @@ if RUNNING_ON_CI:
FlakyTestTimeout
(),
sys
.
exc_info
()[
2
])
else
:
def
reraiseFlakyTestRaceCondition
():
six
.
reraise
(
*
sys
.
exc_info
())
if
LIBUV
:
reraiseFlakyTestRaceConditionLibuv
=
reraiseFlakyTestRaceCondition
reraiseFlakyTestTimeoutLibuv
=
reraiseFlakyTestTimeout
reraiseFlakyTestTimeout
=
reraiseFlakyTestRaceCondition
def
wrap_switch_count_check
(
method
):
@
wraps
(
method
)
...
...
src/greentest/test__pool.py
View file @
948aa7d1
...
...
@@ -93,10 +93,8 @@ class TestCoroutinePool(unittest.TestCase):
pool
.
apply_async
(
evt
.
set
)
evt
.
wait
()
@
greentest
.
skipOnPyPy
(
"Does not work on PyPy"
)
# Why?
def
test_stderr_raising
(
self
):
if
greentest
.
PYPY
:
# Does not work on PyPy
return
# testing that really egregious errors in the error handling code
# (that prints tracebacks to stderr) don't cause the pool to lose
# any members
...
...
@@ -301,7 +299,7 @@ TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14
class
TestPool
(
greentest
.
TestCase
):
__timeout__
=
5
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
20
__timeout__
=
max
(
greentest
.
TestCase
.
__timeout__
,
5
)
size
=
1
def
setUp
(
self
):
...
...
src/greentest/test__threadpool.py
View file @
948aa7d1
...
...
@@ -342,7 +342,10 @@ class TestMaxsize(TestCase):
self
.
assertEqual
(
done
,
[])
self
.
pool
.
maxsize
=
1
gevent
.
sleep
(
0.01
)
self
.
assertEqual
(
done
,
[
1
,
2
])
try
:
self
.
assertEqual
(
done
,
[
1
,
2
])
except
AssertionError
:
greentest
.
reraiseFlakyTestRaceConditionLibuv
()
def
test_setzero
(
self
):
pool
=
self
.
pool
=
ThreadPool
(
3
)
...
...
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