8000 Merge branch 'master' into D20250626_001--node_app · postgrespro/testgres@c1afd7e · GitHub
[go: up one dir, main page]

Skip to content

Commit c1afd7e

Browse files
Merge branch 'master' into D20250626_001--node_app
2 parents 3fe3e94 + 69f8
8000
d49 commit c1afd7e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/test_testgres_common.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -622,13 +622,12 @@ def LOCAL__test_lines():
622622
assert (master._logger.is_alive())
623623
finally:
624624
# It is a hack code to logging cleanup
625-
logging._acquireLock()
626-
assert logging.Logger.manager is not None
627-
assert C_NODE_NAME in logging.Logger.manager.loggerDict.keys()
628-
logging.Logger.manager.loggerDict.pop(C_NODE_NAME, None)
629-
assert not (C_NODE_NAME in logging.Logger.manager.loggerDict.keys())
630-
assert not (handler in logging._handlers.values())
631-
logging._releaseLock()
625+
with logging._lock:
626+
assert logging.Logger.manager is not None
627+
assert C_NODE_NAME in logging.Logger.manager.loggerDict.keys()
628+
logging.Logger.manager.loggerDict.pop(C_NODE_NAME, None)
629+
assert not (C_NODE_NAME in logging.Logger.manager.loggerDict.keys())
630+
assert not (handler in logging._handlers.values())
632631
# GO HOME!
633632
return
634633

0 commit comments

Comments
 (0)
0