From c17b634913628e655a9b447613d5ef679b833a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 16 Jan 2018 21:32:15 +0100 Subject: [PATCH] tests: clear PCIDevice cache after each test This is yet another place where references to VM objects contribute to object leaks. --- qubes/tests/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qubes/tests/__init__.py b/qubes/tests/__init__.py index 8c1deb7b..a9553791 100644 --- a/qubes/tests/__init__.py +++ b/qubes/tests/__init__.py @@ -60,6 +60,7 @@ import qubes.config import qubes.devices import qubes.events import qubes.exc +import qubes.ext.pci import qubes.vm.standalonevm import qubes.vm.templatevm @@ -378,6 +379,7 @@ class QubesTestCase(unittest.TestCase): self.loop = asyncio.get_event_loop() self.addCleanup(self.cleanup_loop) + self.addCleanup(qubes.ext.pci._cache_get.cache_clear) def cleanup_gc(self): gc.collect()