Skip to content

Commit 78064d0

Browse files
committed
skip SystemStackError
with -O0 build, prism parser consumes a lot of machine stack and it doesn't work with minimum machine stack for threads, which specified with `RUBY_THREAD_MACHINE_STACK_SIZE=1`. So simply ignore `SystemStackError` for btest.
1 parent 97aaf6f commit 78064d0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

bootstraptest/test_ractor.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,13 @@ def require feature
18381838
end
18391839
18401840
Ractor.new{
1841-
require 'benchmark'
1842-
Benchmark.measure{}
1841+
begin
1842+
require 'benchmark'
1843+
Benchmark.measure{}
1844+
rescue SystemStackError
1845+
# prism parser with -O0 build consumes a lot of machine stack
1846+
Data.define(:real).new(1)
1847+
end
18431848
}.take.real > 0
18441849
}
18451850

@@ -1883,7 +1888,12 @@ def require feature
18831888
autoload :Benchmark, 'benchmark'
18841889
18851890
r = Ractor.new do
1886-
Benchmark.measure{}
1891+
begin
1892+
Benchmark.measure{}
1893+
rescue SystemStackError
1894+
# prism parser with -O0 build consumes a lot of machine stack
1895+
Data.define(:real).new(1)
1896+
end
18871897
end
18881898
r.take.real > 0
18891899
}

0 commit comments

Comments
 (0)