From e09d19463dfffc9f6b68ff99593fb96f2bdf5233 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Fri, 24 Feb 2023 09:53:28 -0500 Subject: [PATCH] Logging errors breaks some tests. --- src/allmydata/storage_client.py | 5 ++++- src/allmydata/test/test_storage_client.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allmydata/storage_client.py b/src/allmydata/storage_client.py index 53131c88a..a2726fe09 100644 --- a/src/allmydata/storage_client.py +++ b/src/allmydata/storage_client.py @@ -951,7 +951,10 @@ async def _pick_a_http_server( result.callback(nurl) def failed(failure, failures=[], result=result): - log.err(failure, "Failed to connect to NURL") + # Logging errors breaks a bunch of tests, and it's not a _bug_ to + # have a failed connection, it's often expected and transient. More + # of a warning, really? + log.msg("Failed to connect to NURL: {}".format(failure)) failures.append(None) if len(failures) == len(nurls): # All our potential NURLs failed... diff --git a/src/allmydata/test/test_storage_client.py b/src/allmydata/test/test_storage_client.py index 38ef8c1d3..d7420b62f 100644 --- a/src/allmydata/test/test_storage_client.py +++ b/src/allmydata/test/test_storage_client.py @@ -791,5 +791,4 @@ class PickHTTPServerTests(unittest.SynchronousTestCase): ], bad_url: [(0.1, RuntimeError()), (0.1, RuntimeError()), (0.1, RuntimeError())] }) - self.flushLoggedErrors(ZeroDivisionError, RuntimeError) self.assertEqual(self.successResultOf(d), eventually_good_url)