summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorÉtienne Barrié <[email protected]>2025-05-23 15:58:05 +0200
committerJean Boussier <[email protected]>2025-05-23 21:28:16 +0200
commit2a951f62e117549a3e442925886859264fe809e6 (patch)
tree12e58ce8edce9bb732d5a3e628c01c691f317b6e /test/ruby
parentf64c89f18d3a0cd15ea334d43f73f72e7bd99140 (diff)
Change test to avoid stack overflow with MN threads
When using MN threads (such as running the test in a ractor), this test failed because it was raising a SystemStackError: stack level too deep. This is because the machine stack is smaller under MN threads than on the native main thread.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13427
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_hash.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb
index 7b8cf1c6c4..dbf041a732 100644
--- a/test/ruby/test_hash.rb
+++ b/test/ruby/test_hash.rb
@@ -2138,7 +2138,9 @@ class TestHashOnly < Test::Unit::TestCase
def test_iterlevel_in_ivar_bug19589
h = { a: nil }
- hash_iter_recursion(h, 200)
+ # Recursion level should be over 127 to actually test iterlevel being set in an instance variable,
+ # but it should be under 131 not to overflow the stack under MN threads/ractors.
+ hash_iter_recursion(h, 130)
assert true
end