Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-111798: skip test_super_deep() from test_call under pydebug builds on WASI #114010

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Lib/test/test_call.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from test.support import cpython_only, requires_limited_api, skip_on_s390x
from test.support import (cpython_only, is_wasi, requires_limited_api, Py_DEBUG,
set_recursion_limit, skip_on_s390x)
try:
import _testcapi
except ImportError:
Expand Down Expand Up @@ -990,6 +991,7 @@ def case_change_over_substitution(BLuch=None, Luch = None, fluch = None):
class TestRecursion(unittest.TestCase):

@skip_on_s390x
@unittest.skipIf(is_wasi and Py_DEBUG, "requires deep stack")
def test_super_deep(self):

def recurse(n):
Expand All @@ -1010,9 +1012,7 @@ def c_py_recurse(m):
if m:
_testcapi.pyobject_vectorcall(py_recurse, (1000, m), ())

depth = sys.getrecursionlimit()
sys.setrecursionlimit(100_000)
try:
with set_recursion_limit(100_000):
recurse(90_000)
with self.assertRaises(RecursionError):
recurse(101_000)
Expand All @@ -1022,8 +1022,6 @@ def c_py_recurse(m):
c_py_recurse(90)
with self.assertRaises(RecursionError):
c_py_recurse(100_000)
finally:
sys.setrecursionlimit(depth)


class TestFunctionWithManyArgs(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Disable ``test_super_deep()`` from ``test_call`` under pydebug builds on
WASI; the stack depth is too small to make the test useful.
Loading