aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-12-04 21:35:46 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-12-05 01:08:19 +0900
commit6ee4b285036ea0deb13d318fe0a5025e46987cef (patch)
treed0174c0dbd848c819a9d92725e6d84fcdadf63ad
parentfdf417d72304474809ff138726ce829a52b8c896 (diff)
downloadruby-openssl-topic/under-gc-stress.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].
-rw-r--r--test/utils.rb9
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