diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-12-04 21:35:46 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-12-05 01:08:19 +0900 |
commit | 6ee4b285036ea0deb13d318fe0a5025e46987cef (patch) | |
tree | d0174c0dbd848c819a9d92725e6d84fcdadf63ad /test/utils.rb | |
parent | fdf417d72304474809ff138726ce829a52b8c896 (diff) | |
download | ruby-openssl-6ee4b285036ea0deb13d318fe0a5025e46987cef.tar.gz |
test: run test cases under GC.stress if OSSL_GC_STRESS is specifiedtopic/under-gc-stress
This would have caught some of GC issues like one reported at
[ruby/openssl#87].
Diffstat (limited to 'test/utils.rb')
-rw-r--r-- | test/utils.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/utils.rb b/test/utils.rb index 1be8db41..bbc9c7ef 100644 --- a/test/utils.rb +++ b/test/utils.rb @@ -201,7 +201,16 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC end class OpenSSL::TestCase < Test::Unit::TestCase + def setup + if ENV["OSSL_GC_STRESS"] == "1" + GC.stress = true + end + end + def teardown + if ENV["OSSL_GC_STRESS"] == "1" + GC.stress = false + end # OpenSSL error stack must be empty assert_equal([], OpenSSL.errors) end |