Merge "Run a more GC iterations to make sure weakrefs are collected"

This commit is contained in:
Jenkins 2013-08-23 12:59:41 +00:00 committed by Gerrit Code Review
commit bc75061740

View File

@ -4441,7 +4441,7 @@ class TestObjectController(unittest.TestCase):
self.assertEqual(headers[:len(exp)], exp) self.assertEqual(headers[:len(exp)], exp)
# Remember Request instance count, make sure the GC is run for pythons # Remember Request instance count, make sure the GC is run for pythons
# without reference counting. # without reference counting.
for i in xrange(3): for i in xrange(4):
gc.collect() gc.collect()
before_request_instances = len(_request_instances) before_request_instances = len(_request_instances)
# GET test file, but disconnect early # GET test file, but disconnect early
@ -4460,7 +4460,7 @@ class TestObjectController(unittest.TestCase):
fd.close() fd.close()
sock.close() sock.close()
# Make sure the GC is run again for pythons without reference counting # Make sure the GC is run again for pythons without reference counting
for i in xrange(3): for i in xrange(4):
gc.collect() gc.collect()
self.assertEquals(before_request_instances, len(_request_instances)) self.assertEquals(before_request_instances, len(_request_instances))