Skip to content

Commit 28db9bb

Browse files
committed
tests: Fix test_LoggerFileObject_recursion
It used to be that when a logger encountered an error trying to handle / emit a message, it would attempt to log about the error via the same logger. Long ago, this could lead to infinite recursion in Swift's LoggerFileObject, so we fixed it and added a test that included showing the bad stdlib behavior. Recently, stdlib did a similar fix so the recursion doesn't happen. See - python/cpython#91555 and - python/cpython#131812 Of course, now our test breaks (at least, on 3.13.4). Relax the assertion a little. Related-Change: Ia9ecffc88ce43616977e141498e5ee404f2c29c4 Change-Id: Id2f490d4204b8eaf07857cb84ed783bec19b8511
1 parent ad41dbe commit 28db9bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/unit/common/utils/test_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def emit(self, record):
182182
# pdb is basically impossible. Sorry about that.
183183
utils.capture_stdio(logger)
184184
logger.info("I like ham")
185-
self.assertGreater(crashy_calls[0], 1)
185+
self.assertGreaterEqual(crashy_calls[0], 1)
186186

187187
logger.removeHandler(handler)
188188

0 commit comments

Comments
 (0)