Skip to content

Commit 3ec44a9

Browse files
committed
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 ruby/mmtk#49.
1 parent 010b23a commit 3ec44a9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

bootstraptest/test_ractor.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,3 +2350,23 @@ def call_test(obj)
23502350
end
23512351
:ok
23522352
RUBY
2353+
2354+
assert_equal 'ok', <<~'RUBY'
2355+
begin
2356+
100.times do |i|
2357+
Ractor.new(i) do |j|
2358+
1000.times do |i|
2359+
"#{j}-#{i}"
2360+
end
2361+
Ractor.receive
2362+
end
2363+
pid = fork { }
2364+
_, status = Process.waitpid2 pid
2365+
raise unless status.success?
2366+
end
2367+
2368+
:ok
2369+
rescue NotImplementedError
2370+
:ok
2371+
end
2372+
RUBY

0 commit comments

Comments
 (0)