Merge "Fix glance-api process leak in respawn storm test."
This commit is contained in:
commit
5c2cfa4e6b
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user