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:
Tim Burke
2024年02月14日 17:43:09 +00:00
parent 51ae9b00c9
commit 1ee9b1e3ba

View File

@@ -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
openstack/swift
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.

The note is not visible to the blocked user.