Commit 17468451 authored by Denis Bilenko's avatar Denis Bilenko

test case for memory leak fixed in 1637:51f0fddafa98 by Ned Rockson

parent 89a243c7
import sys
from greentest import TestCase, main
import gevent
from gevent.timeout import Timeout
class TestQueue(TestCase):
def test(self):
result = ''
try:
Timeout.start_new(0.01)
gevent.sleep(1)
raise AssertionError('must raise Timeout')
except KeyboardInterrupt:
raise
except:
pass
result += '%s ' % sys.gettotalrefcount()
try:
Timeout.start_new(0.01)
gevent.sleep(1)
raise AssertionError('must raise Timeout')
except KeyboardInterrupt:
raise
except:
pass
result += '%s ' % sys.gettotalrefcount()
try:
Timeout.start_new(0.01)
gevent.sleep(1)
raise AssertionError('must raise Timeout')
except KeyboardInterrupt:
raise
except:
pass
result += '%s' % sys.gettotalrefcount()
a, b, c = result.split()
assert b == c, 'total refcount mismatch: %s' % result
if __name__ == '__main__':
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