@@ -660,14 +660,16 @@ def test_concat
660660 assert_raise ( TypeError ) { @cls [ 0 ] . concat ( :foo ) }
661661 assert_raise ( FrozenError ) { @cls [ 0 ] . freeze . concat ( :foo ) }
662662
663- a = @cls [ nil ]
664- def ( x = Object . new ) . to_ary
665- ary = Array . new ( 2 )
666- ary << [ ] << [ ] << :ok
663+ unless multiple_ractors?
664+ a = @cls [ nil ]
665+ def ( x = Object . new ) . to_ary
666+ ary = Array . new ( 2 )
667+ ary << [ ] << [ ] << :ok
668+ end
669+ EnvUtil . under_gc_stress { a . concat ( x ) }
670+ GC . start
671+ assert_equal ( :ok , a . last )
667672 end
668- EnvUtil . under_gc_stress { a . concat ( x ) }
669- GC . start
670- assert_equal ( :ok , a . last )
671673 end
672674
673675 def test_count
@@ -1476,6 +1478,7 @@ def test_replace
14761478 end
14771479
14781480 def test_replace_wb_variable_width_alloc
1481+ omit "not working properly across ractors" if multiple_ractors?
14791482 small_embed = [ ]
14801483 4 . times { GC . start } # age small_embed
14811484 large_embed = [ 1 , 2 , 3 , 4 , 5 , Array . new ] # new young object
@@ -2444,11 +2447,13 @@ def test_product
24442447 assert_equal ( @cls [ ] , @cls [ 1 , 2 ] . product ( [ ] ) )
24452448
24462449 bug3394 = '[ruby-dev:41540]'
2447- acc = [ ]
2448- EnvUtil . under_gc_stress { [ 1 , 2 ] . product ( [ 3 , 4 , 5 ] , [ 6 , 8 ] ) { |array | acc << array } }
2449- assert_equal ( [ [ 1 , 3 , 6 ] , [ 1 , 3 , 8 ] , [ 1 , 4 , 6 ] , [ 1 , 4 , 8 ] , [ 1 , 5 , 6 ] , [ 1 , 5 , 8 ] ,
2450- [ 2 , 3 , 6 ] , [ 2 , 3 , 8 ] , [ 2 , 4 , 6 ] , [ 2 , 4 , 8 ] , [ 2 , 5 , 6 ] , [ 2 , 5 , 8 ] ] ,
2451- acc , bug3394 )
2450+ unless multiple_ractors?
2451+ acc = [ ]
2452+ EnvUtil . under_gc_stress { [ 1 , 2 ] . product ( [ 3 , 4 , 5 ] , [ 6 , 8 ] ) { |array | acc << array } }
2453+ assert_equal ( [ [ 1 , 3 , 6 ] , [ 1 , 3 , 8 ] , [ 1 , 4 , 6 ] , [ 1 , 4 , 8 ] , [ 1 , 5 , 6 ] , [ 1 , 5 , 8 ] ,
2454+ [ 2 , 3 , 6 ] , [ 2 , 3 , 8 ] , [ 2 , 4 , 6 ] , [ 2 , 4 , 8 ] , [ 2 , 5 , 6 ] , [ 2 , 5 , 8 ] ] ,
2455+ acc , bug3394 )
2456+ end
24522457
24532458 def ( o = Object . new ) . to_ary ; GC . start ; [ 3 , 4 ] end
24542459 acc = [ 1 , 2 ] . product ( *[ o ] *10 )
0 commit comments