From 397a509b6d0d1470df8c290d7c4adef78f1532ee Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 15 Dec 2021 01:11:45 +0900 Subject: prohibit load by `autoload` on non-main Ractor fix [Bug #18120] --- bootstraptest/test_ractor.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index e259684974..5d9edb26d6 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -211,6 +211,17 @@ assert_equal '[:a, :b, :c, :d, :e, :f, :g]', %q{ Ractor.make_shareable(closure).call } +# Now autoload in non-main Ractor is not supported +assert_equal 'ok', %q{ + autoload :Foo, 'foo.rb' + r = Ractor.new do + p Foo + rescue Ractor::UnsafeError + :ok + end + r.take +} + ### ### # Ractor still has several memory corruption so skip huge number of tests -- cgit v1.2.3