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
This commit is contained in:
Tim Burke 2022-06-21 22:52:41 -07:00
parent be87b29a72
commit b9f1f4d60f

View File

@ -458,6 +458,9 @@ class TestInternalClient(unittest.TestCase):
fake_logger = debug_logger() fake_logger = debug_logger()
logger = utils.LogAdapter(fake_logger, 'test-server') 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') logger.debug('Before request')
client = InternalClient(self, logger) client = InternalClient(self, logger)
client.make_request('GET', '/', {}, (200,)) client.make_request('GET', '/', {}, (200,))