From afa3bdf2c7c22dd2e532d9b8971c96d90122548e Mon Sep 17 00:00:00 2001 From: Mitch Burton Date: Tue, 26 Nov 2024 17:44:15 -0800 Subject: [PATCH] fix: get tests passing on plucky --- landscape/lib/testing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/landscape/lib/testing.py b/landscape/lib/testing.py index 1c13b962d..b9c6e06c9 100644 --- a/landscape/lib/testing.py +++ b/landscape/lib/testing.py @@ -685,7 +685,12 @@ def fake(): # because the call might cancel it! call._data = self.call_later(seconds, fake)._data try: - f(*args, **kwargs) + deferred = f(*args, **kwargs) + + if hasattr(deferred, "result") and isinstance(deferred.result, Failure): + # Required for some failures to get GC'd properly flushed. + # Twisted did this in versions < 24.10, but now we have to. + deferred.result.cleanFailure() except Exception: if call.active: self.cancel_call(call)