Commit 4e00a77c authored by Jason Madden's avatar Jason Madden

More fixes for leakchecks.

parent 6f4eac96
......@@ -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
......
......@@ -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()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment