Use EnvUtil.under_gc_stress

This commit is contained in:
Nobuyoshi Nakada 2021-03-31 22:14:15 +09:00
parent 1fac99afda
commit 2a02b61fae
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -244,16 +244,12 @@ class TestObjSpace < Test::Unit::TestCase
end end
def test_trace_object_allocations_gc_stress def test_trace_object_allocations_gc_stress
prev = GC.stress EnvUtil.under_gc_stress do
GC.stress = true ObjectSpace.trace_object_allocations{
proc{}
ObjectSpace.trace_object_allocations{ }
proc{} end
}
assert true # success assert true # success
ensure
GC.stress = prev
end end
def test_dump_flags def test_dump_flags