summaryrefslogtreecommitdiff
path: root/test/objspace/test_ractor.rb
blob: 4901eeae2e16f87c33f559c104eb56ee48630544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "test/unit"

class TestObjSpaceRactor < Test::Unit::TestCase
  def test_tracing_does_not_crash
    assert_ractor(<<~RUBY, require: 'objspace')
      ObjectSpace.trace_object_allocations do
        r = Ractor.new do
          obj = 'a' * 1024
          Ractor.yield obj
        end

        r.take
        r.take
      end
    RUBY
  end
end