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.
This commit is contained in:
Marek Marczykowski-Górecki 2018-04-05 00:36:34 +02:00
parent 3726692530
commit 8df90f1a86
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -410,6 +410,9 @@ class QubesTestCase(unittest.TestCase):
global libvirt_event_impl global libvirt_event_impl
# really destroy all objects that could have used loop and/or libvirt
gc.collect()
# Check for unfinished libvirt business. # Check for unfinished libvirt business.
if libvirt_event_impl is not None: if libvirt_event_impl is not None:
try: try: