Merge "Fix glance-api process leak in respawn storm test."

This commit is contained in:
Jenkins 2012-05-18 19:26:17 +00:00 committed by Gerrit Code Review
commit 5c2cfa4e6b

View File

@ -46,7 +46,7 @@ class TestMultiprocessing(functional.FunctionalTest):
cmd = ("ps -fu $USER | grep glance-api | " cmd = ("ps -fu $USER | grep glance-api | "
"grep -v grep | awk '{print $2}' | sort -nr") "grep -v grep | awk '{print $2}' | sort -nr")
_, out, _ = execute(cmd, raise_error=True) _, out, _ = execute(cmd, raise_error=True)
return out.split('\n')[0:-2] return out.split('\n')[0:2]
def test_interrupt_avoids_respawn_storm(self): def test_interrupt_avoids_respawn_storm(self):
""" """
@ -63,7 +63,7 @@ class TestMultiprocessing(functional.FunctionalTest):
for _ in range(0, 9): for _ in range(0, 9):
time.sleep(0.05) time.sleep(0.05)
# ensure number of children hasn't grown # ensure number of children hasn't grown
self.assertTrue(len(children) > len(self._get_children())) self.assertTrue(len(children) >= len(self._get_children()))
for child in self._get_children(): for child in self._get_children():
# ensure no new children spawned # ensure no new children spawned
self.assertTrue(child in children) self.assertTrue(child in children)