1 # -*- encoding: binary -*-
2 # frozen_string_literal: false
6 class TestRaindropsGc < Test::Unit::TestCase
8 # we may need to create more garbage as GC may be less aggressive
9 # about expiring things. This is completely unrealistic code,
12 assert_nothing_raised do
13 1000000.times { |i| Raindrops.new(24); [] }
25 _, status = Process.waitpid2(pid)
26 assert status.success?
27 assert_equal [ 0, 0 ], tmp.to_ary
29 assert_equal [ 0, 1 ], tmp.to_ary
32 exit([ 0, 2 ] == tmp.to_ary)
34 _, status = Process.waitpid2(pid)
35 assert status.success?
36 assert_equal [ 0, 2 ], tmp.to_ary
38 end if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" &&
39 ENV["STRESS"].to_i != 0