From b2999d283fb4a3d560c783626103b9d0498153df Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 21 Oct 2020 12:37:34 -0400 Subject: [PATCH] Somewhat clarify this test --- src/allmydata/test/web/test_common.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/web/test_common.py b/src/allmydata/test/web/test_common.py index dd859befb..2a0ebd3d8 100644 --- a/src/allmydata/test/web/test_common.py +++ b/src/allmydata/test/web/test_common.py @@ -2,6 +2,8 @@ Tests for ``allmydata.web.common``. """ +import gc + from bs4 import ( BeautifulSoup, ) @@ -228,8 +230,8 @@ class RenderExceptionTests(SyncTestCase): def test_disconnected(self): """ - If the transport is disconnected before the response is available, nothing - is written to the request. + If the transport is disconnected before the response is available, no + ``RuntimeError`` is logged for finishing a disconnected request. """ result = Deferred() resource = StaticResource(result) @@ -247,3 +249,9 @@ class RenderExceptionTests(SyncTestCase): ), ), ) + + # Since we're not a trial TestCase we don't have flushLoggedErrors. + # The next best thing is to make sure any dangling Deferreds have been + # garbage collected and then let the generic trial logic for failing + # tests with logged errors kick in. + gc.collect()