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
50f03644
Commit
50f03644
authored
Nov 09, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a potentially flaky test in test__local.py
Fixes #1167 and fixes #1168
parent
d045dd23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
src/gevent/testing/__init__.py
src/gevent/testing/__init__.py
+1
-0
src/gevent/tests/known_failures.py
src/gevent/tests/known_failures.py
+1
-1
src/gevent/tests/test__local.py
src/gevent/tests/test__local.py
+16
-9
src/gevent/tests/test__threadpool.py
src/gevent/tests/test__threadpool.py
+1
-0
No files found.
src/gevent/testing/__init__.py
View file @
50f03644
...
...
@@ -120,6 +120,7 @@ BaseTestCase = unittest.TestCase
from
.flaky
import
reraiseFlakyTestTimeout
from
.flaky
import
reraiseFlakyTestRaceCondition
from
.flaky
import
reraises_flaky_timeout
from
.flaky
import
reraises_flaky_race_condition
try
:
from
unittest
import
mock
...
...
src/gevent/tests/known_failures.py
View file @
50f03644
...
...
@@ -215,7 +215,7 @@ if PYPY:
# This test, which normally takes 4-5s, sometimes
# hangs forever after running two tests. I cannot reproduce,
# it seems highly load dependent. Observed with both libev and libuv.
'test_threading_2.py'
,
'test_
_
threading_2.py'
,
]
if
PY3
and
TRAVIS
:
...
...
src/gevent/tests/test__local.py
View file @
50f03644
...
...
@@ -341,19 +341,26 @@ class TestGeventLocal(greentest.TestCase):
self
.
assertEqual
(
count
,
len
(
deleted_sentinels
))
@
greentest
.
skipOnPyPy
(
"GC makes this non-deterministic, especially on Windows"
)
@
greentest
.
ignores_leakcheck
def
test_local_dicts_for_greenlet
(
self
):
# In fact, only on Windows do we see gc being an issue;
# pypy2 5.10 on macOS and Travis don't have a problem.
import
gevent
from
gevent.local
import
all_local_dicts_for_greenlet
x
=
MyLocal
()
x
.
foo
=
42
del
x
.
sentinel
results
=
all_local_dicts_for_greenlet
(
gevent
.
getcurrent
())
self
.
assertEqual
(
results
,
[((
MyLocal
,
id
(
x
)),
{
'foo'
:
42
})])
class
MyGreenlet
(
gevent
.
Greenlet
):
results
=
None
id_x
=
None
def
_run
(
self
):
# pylint:disable=method-hidden
x
=
local
()
x
.
foo
=
42
self
.
id_x
=
id
(
x
)
self
.
results
=
all_local_dicts_for_greenlet
(
self
)
g
=
MyGreenlet
()
g
.
start
()
g
.
join
()
self
.
assertTrue
(
g
.
successful
,
g
)
self
.
assertEqual
(
g
.
results
,
[((
local
,
g
.
id_x
),
{
'foo'
:
42
})])
def
test_local_with_abc
(
self
):
# an ABC (or generally any non-exact-type) in the MRO doesn't
...
...
src/gevent/tests/test__threadpool.py
View file @
50f03644
...
...
@@ -428,6 +428,7 @@ class TestMaxsize(TestCase):
class
TestSize
(
TestCase
):
@
greentest
.
reraises_flaky_race_condition
()
def
test
(
self
):
pool
=
self
.
pool
=
self
.
_makeOne
(
2
,
increase
=
False
)
self
.
assertEqual
(
pool
.
size
,
0
)
...
...
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