diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2023-11-28 09:26:55 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2023-11-28 17:43:22 -0500 |
| commit | 10f44dfeff631e4298461493514229c0d744bebe (patch) | |
| tree | ca5f710710b186717ae7d785bb333fdb4b8498d7 /test/ruby | |
| parent | 6eb5a9cf8f99b64d97d26b41011c03b846317d3e (diff) | |
Fix Ractor sharing for too complex Objects
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_shapes.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index 148595ac32..e3532c5ae0 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -621,6 +621,24 @@ class TestShapes < Test::Unit::TestCase end; end + def test_too_complex_obj_ivar_ractor_share + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + $VERBOSE = nil + + RubyVM::Shape.exhaust_shapes + + r = Ractor.new do + o = Object.new + o.instance_variable_set(:@a, "hello") + Ractor.yield(o) + end + + o = r.take + assert_equal "hello", o.instance_variable_get(:@a) + end; + end + def test_too_complex_generic_ivar_ractor_share assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") begin; |
