GH-111802: set a low recursion limit for `test_bad_getattr()` in `test.pickletester` (GH-113996)

This commit is contained in:
Brett Cannon 2024-01-12 14:14:09 -08:00 committed by GitHub
parent b44b9d9900
commit 8aa126354d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -2437,7 +2437,7 @@ class AbstractPickleTests:
# Issue #3514: crash when there is an infinite loop in __getattr__
x = BadGetattr()
for proto in range(2):
with support.infinite_recursion():
with support.infinite_recursion(25):
self.assertRaises(RuntimeError, self.dumps, x, proto)
for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
s = self.dumps(x, proto)

View File

@ -0,0 +1,3 @@
Specify a low recursion depth for ``test_bad_getattr()`` in
``test.pickletester`` to avoid exhausting the stack under a pydebug build
for WASI.