tests: Clear txn id on init for all debug loggers
Since we fake out all the greenthread stuff to run in the main thread, we can (sometimes?) find that a transaction ID has already been set, leading to failures in test_bad_request_app_logging like AssertionError: b'X-Trans-Id: test-trans-id' not found in b'X-Trans-Id: tx...' By resetting the logger's txn_id, we're assured that our mock will be run and the expected transaction ID will be used. Change-Id: I465eed5372a2a5e591f80a09676f4b7f091cd444
This commit is contained in:
1 changed files with 3 additions and 0 deletions
@@ -249,6 +249,9 @@ class DebugLogger(FakeLogger):
class DebugLogAdapter(utils.LogAdapter):
def __init__(self, *args, **kwargs):
super(DebugLogAdapter, self).__init__(*args, **kwargs)
self.txn_id = None
def __getattribute__(self, name):
try:
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.