diff --git a/test/utils.rb b/test/utils.rb index 1be8db41d..e855ffa26 100644 --- a/test/utils.rb +++ b/test/utils.rb @@ -201,7 +201,16 @@ def silent end class OpenSSL::TestCase < Test::Unit::TestCase + def setup + if ENV["OSSL_GC_STRESS"] == "1" + @_stress, GC.stress = GC.stress, true + end + end + def teardown + if ENV["OSSL_GC_STRESS"] == "1" + GC.stress = @_stress + end # OpenSSL error stack must be empty assert_equal([], OpenSSL.errors) end