From 2a02b61fae2c5dcfaf123f43c08c7c7949c1790c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 31 Mar 2021 22:14:15 +0900 Subject: Use EnvUtil.under_gc_stress --- test/objspace/test_objspace.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 1ccee02faa..97f3d60882 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -244,16 +244,12 @@ class TestObjSpace < Test::Unit::TestCase end def test_trace_object_allocations_gc_stress - prev = GC.stress - GC.stress = true - - ObjectSpace.trace_object_allocations{ - proc{} - } - + EnvUtil.under_gc_stress do + ObjectSpace.trace_object_allocations{ + proc{} + } + end assert true # success - ensure - GC.stress = prev end def test_dump_flags -- cgit v1.2.3