Disable gc in test_scheduler.TestExecutor
Fix random failures seens in test_scheduler.TestExecutor. Saw random failures sometime on py35 sometime on py36 test on the pagure driver patch: https://review.opendev.org/604404/ With that patch I no longer see the random failures. This disable is already done in tests/base.py assertFinalState. Change-Id: I156f85cacd8c14e0205f629dc273d1d9c390ab81
This commit is contained in:
parent
48c049db79
commit
aeb5ef4ef6
@ -5740,11 +5740,17 @@ class TestExecutor(ZuulTestCase):
|
|||||||
|
|
||||||
# Make sure that git.Repo objects have been garbage collected.
|
# Make sure that git.Repo objects have been garbage collected.
|
||||||
repos = []
|
repos = []
|
||||||
gc.collect()
|
gc.disable()
|
||||||
for obj in gc.get_objects():
|
try:
|
||||||
if isinstance(obj, git.Repo):
|
gc.collect()
|
||||||
self.log.debug("Leaked git repo object: %s" % repr(obj))
|
for obj in gc.get_objects():
|
||||||
repos.append(obj)
|
if isinstance(obj, git.Repo):
|
||||||
|
self.log.debug("Leaked git repo object: %s" % repr(obj))
|
||||||
|
repos.append(obj)
|
||||||
|
gc.enable()
|
||||||
|
except Exception:
|
||||||
|
gc.enable()
|
||||||
|
raise
|
||||||
self.assertEqual(len(repos), 0)
|
self.assertEqual(len(repos), 0)
|
||||||
|
|
||||||
def test_executor_shutdown(self):
|
def test_executor_shutdown(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user