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
4e00a77c
Commit
4e00a77c
authored
May 19, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More fixes for leakchecks.
parent
6f4eac96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
src/gevent/testing/leakcheck.py
src/gevent/testing/leakcheck.py
+8
-8
src/gevent/tests/test__semaphore.py
src/gevent/tests/test__semaphore.py
+6
-1
No files found.
src/gevent/testing/leakcheck.py
View file @
4e00a77c
...
...
@@ -89,7 +89,6 @@ class _RefCountChecker(object):
return
False
return
True
def
_growth
(
self
):
return
objgraph
.
growth
(
limit
=
None
,
peak_stats
=
self
.
peak_stats
,
filter
=
self
.
_ignore_object_p
)
...
...
@@ -198,14 +197,15 @@ class _RefCountChecker(object):
def
wrap_refcount
(
method
):
if
objgraph
is
None
:
import
warnings
warnings
.
warn
(
"objgraph not available, leakchecks disabled"
)
return
method
if
getattr
(
method
,
'ignore_leakcheck'
,
False
):
return
method
if
objgraph
is
None
or
getattr
(
method
,
'ignore_leakcheck'
,
False
):
if
objgraph
is
None
:
import
warnings
warnings
.
warn
(
"objgraph not available, leakchecks disabled"
)
@
wraps
(
method
)
def
_method_skipped_during_leakcheck
(
self
,
*
_args
,
**
_kwargs
):
self
.
skipTest
(
"This method ignored during leakchecks"
)
return
_method_skipped_during_leakcheck
@
wraps
(
method
)
def
wrapper
(
self
,
*
args
,
**
kwargs
):
# pylint:disable=too-many-branches
...
...
src/gevent/tests/test__semaphore.py
View file @
4e00a77c
...
...
@@ -282,7 +282,6 @@ def release_then_spawn(sem, should_quit):
class
TestSemaphoreFair
(
greentest
.
TestCase
):
@
greentest
.
ignores_leakcheck
def
test_fair_or_hangs
(
self
):
# If the lock isn't fair, this hangs, spinning between
# the last two greenlets.
...
...
@@ -301,6 +300,12 @@ class TestSemaphoreFair(greentest.TestCase):
self
.
assertTrue
(
keep_going2
.
dead
,
keep_going2
)
self
.
assertFalse
(
keep_going1
.
dead
,
keep_going1
)
sem
.
release
()
keep_going1
.
kill
()
keep_going2
.
kill
()
exiting
.
kill
()
gevent
.
idle
()
if
__name__
==
'__main__'
:
greentest
.
main
()
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