Add a Ractor test case that causes MMTk to deadlock

This was a test case for Ractors discovered that causes MMTk to deadlock.
There is a fix for it in https://github.com/ruby/mmtk/pull/49.
This commit is contained in:
Peter Zhu 2025-11-17 21:53:30 -05:00
parent 010b23a7cf
commit 3ec44a9995

View File

@ -2350,3 +2350,23 @@ assert_equal 'ok', <<~'RUBY'
end
:ok
RUBY
assert_equal 'ok', <<~'RUBY'
begin
100.times do |i|
Ractor.new(i) do |j|
1000.times do |i|
"#{j}-#{i}"
end
Ractor.receive
end
pid = fork { }
_, status = Process.waitpid2 pid
raise unless status.success?
end
:ok
rescue NotImplementedError
:ok
end
RUBY