From aa80c9ef4748cf10e3b448b298df8b589c35cafd Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 28 Nov 2022 10:21:59 -0500 Subject: [PATCH] Be more robust. --- src/allmydata/test/test_storage_https.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_storage_https.py b/src/allmydata/test/test_storage_https.py index 284c8cda8..a11b0eed5 100644 --- a/src/allmydata/test/test_storage_https.py +++ b/src/allmydata/test/test_storage_https.py @@ -12,6 +12,7 @@ from cryptography import x509 from twisted.internet.endpoints import serverFromString from twisted.internet import reactor +from twisted.internet.defer import maybeDeferred from twisted.web.server import Site from twisted.web.static import Data from twisted.web.client import Agent, HTTPConnectionPool, ResponseNeverReceived @@ -88,8 +89,8 @@ class PinningHTTPSValidation(AsyncTestCase): return AsyncTestCase.setUp(self) def tearDown(self): - AsyncTestCase.tearDown(self) - return spin_until_cleanup_done() + d = maybeDeferred(AsyncTestCase.tearDown, self) + return d.addCallback(lambda _: spin_until_cleanup_done()) @asynccontextmanager async def listen(self, private_key_path: FilePath, cert_path: FilePath):