aboutsummaryrefslogtreecommitdiffstats
path: root/test/openssl/test_pair.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_pair.rb')
-rw-r--r--test/openssl/test_pair.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index f627066d76..c7cfd69129 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -83,16 +83,20 @@ end
module OpenSSL::TestEOF1M
def open_file(content)
s1, s2 = ssl_pair
- Thread.new { s2 << content; s2.close }
+ th = Thread.new { s2 << content; s2.close }
yield s1
+ ensure
+ th.join
end
end
module OpenSSL::TestEOF2M
def open_file(content)
s1, s2 = ssl_pair
- Thread.new { s1 << content; s1.close }
+ th = Thread.new { s1 << content; s1.close }
yield s2
+ ensure
+ th.join
end
end
@@ -317,6 +321,7 @@ module OpenSSL::TestPairM
s1.print "a\ndef"
assert_equal("a\n", s2.gets)
ensure
+ th.join
s1.close if s1 && !s1.closed?
s2.close if s2 && !s2.closed?
sock1.close if sock1 && !sock1.closed?