From 8df90f1a8629ae95695c43814a808805929281b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 5 Apr 2018 00:36:34 +0200 Subject: [PATCH] tests: yet another fix for integration tests cleanup code Before waiting for remaining tasks on event loop (including libvirt events), make sure all destroyed objects are really destroyed. This is especially important for libvirt connections, which gets cleaned up only when appropriate destructor (__del__) register a cleanup callback and it gets called by the loop. --- qubes/tests/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index 367e269e..122a37f7 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -410,6 +410,9 @@ class QubesTestCase(unittest.TestCase): global libvirt_event_impl + # really destroy all objects that could have used loop and/or libvirt + gc.collect() + # Check for unfinished libvirt business. if libvirt_event_impl is not None: try: