tests: collect all SIGCHLD before cleaning event loop

On python 3.6.4 apparently it requires two callbacks runs to cleanup
stale SIGCHLD handlers.
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-17 01:10:43 +01:00
parent 2b80f0c044
commit 76c872a43a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -421,6 +421,13 @@ class QubesTestCase(unittest.TestCase):
except asyncio.TimeoutError:
raise AssertionError('libvirt event impl drain timeout')
# this is stupid, but apparently it requires two passes
# to cleanup SIGCHLD handlers
self.loop.stop()
self.loop.run_forever()
self.loop.stop()
self.loop.run_forever()
# Check there are no Tasks left.
assert not self.loop._ready
assert not self.loop._scheduled