From b9f1f4d60fb459990bb96f5b9a42dc92fb55d52d Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Tue, 21 Jun 2022 22:52:41 -0700 Subject: [PATCH] Ensure clean starting state in test Since it merged, test_make_request_clears_txn_id_after_calling_app would always fail on the first attempt in the gate, but we wouldn't notice because it would succeed on the retry. Trouble is that some tests (like test_catch_errors.py) would pollute the main greenthread's threadlocals. Change-Id: Ibdafc4a321e41d6fd225c486da831b1f0fead882 --- test/unit/common/test_internal_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/unit/common/test_internal_client.py b/test/unit/common/test_internal_client.py index d2b844ac0d..d26ef0e2d1 100644 --- a/test/unit/common/test_internal_client.py +++ b/test/unit/common/test_internal_client.py @@ -458,6 +458,9 @@ class TestInternalClient(unittest.TestCase): fake_logger = debug_logger() logger = utils.LogAdapter(fake_logger, 'test-server') + # Make sure there's no transaction ID set -- other tests may have + # polluted the logger + logger.txn_id = None logger.debug('Before request') client = InternalClient(self, logger) client.make_request('GET', '/', {}, (200,))