Skip to content

Commit 50f555b

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 2da2560 commit 50f555b

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
@@ -957,6 +957,12 @@ def cleanup_app(self):
957957
obj_type = type(getattr(self, attr))
958958
if obj_type.__module__.startswith("qubes"):
959959
delattr(self, attr)
960+
elif issubclass(obj_type, list) and any(
961+
type(obj).__module__.startswith("qubes")
962+
for obj in getattr(self, attr)
963+
):
964+
# remove also list of qubes objects
965+
delattr(self, attr)
960966

961967
# then trigger garbage collector to really destroy those objects
962968
gc.collect()

0 commit comments

Comments
 (0)