Browse Source

tests: collect all SIGCHLD before cleaning event loop

On python 3.6.4 apparently it requires two callbacks runs to cleanup
stale SIGCHLD handlers.
Marek Marczykowski-Górecki 6 years ago
parent
commit
76c872a43a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      qubes/tests/__init__.py

+ 7 - 0
qubes/tests/__init__.py

@@ -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