Skip to content

Commit 53ba014

Browse files
committed
tests: drop references to qubes objects via lists too
There is a code that drops references to Qubes* objects saved directly in test instance attributes already. But 274bb39 "Set deferred netvm for paused clients on shutdown" introduced also a list of such objects, which weren't cleaned up. Fix it by considering lists too - if first element is a qubes object, remove the whole list. Fixes: 274bb39 "Set deferred netvm for paused clients on shutdown"
1 parent fbafa55 commit 53ba014

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

qubes/tests/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,12 @@ def cleanup_app(self):
931931
obj_type = type(getattr(self, attr))
932932
if obj_type.__module__.startswith("qubes"):
933933
delattr(self, attr)
934+
elif issubclass(obj_type, list) and any(
935+
type(obj).__module__.starswith("qubes")
936+
for obj in getattr(self, attr)
937+
):
938+
# remove also list of qubes objects
939+
delattr(self, attr)
934940

935941
# then trigger garbage collector to really destroy those objects
936942
gc.collect()

0 commit comments

Comments
 (0)