Skip to content

Commit

Permalink
test: run test cases under GC.stress if OSSL_GC_STRESS is specified
Browse files Browse the repository at this point in the history
This would have caught some of GC issues like one reported at
[ruby#87].
  • Loading branch information
rhenium committed Dec 4, 2016
1 parent fdf417d commit 9cba8f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9cba8f3

Please sign in to comment.