summaryrefslogtreecommitdiff
path: root/test/openssl/test_pair.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-30 04:43:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-30 04:43:23 +0000
commit176414dfa78900010fd47553ec3c05c5b9eb6659 (patch)
tree92cc32a4087c9dfbd5f78e1951a3e42955b23983 /test/openssl/test_pair.rb
parentfbc4d07087334b970ef1c26d5f8c0d5b569719a5 (diff)
test_pair.rb: join client thread
* test/openssl/test_pair.rb (test_ecdh_callback): join client thread only when it started. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_pair.rb')
-rw-r--r--test/openssl/test_pair.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 588098c668..8e4aefce31 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -86,7 +86,7 @@ module OpenSSL::TestEOF1M
th = Thread.new { s2 << content; s2.close }
yield s1
ensure
- th.join
+ th.join if th
s1.close
end
end
@@ -97,7 +97,7 @@ module OpenSSL::TestEOF2M
th = Thread.new { s1 << content; s1.close }
yield s2
ensure
- th.join
+ th.join if th
s2.close
end
end
@@ -301,7 +301,7 @@ module OpenSSL::TestPairM
assert_equal s1, t.value
assert accept
ensure
- t.join
+ t.join if t
s1.close if s1
s2.close if s2
sock1.close if sock1
@@ -325,7 +325,7 @@ module OpenSSL::TestPairM
assert_equal s1, t.value
assert accept
ensure
- t.join
+ t.join if t
s1.close if s1
s2.close if s2
sock1.close if sock1
@@ -365,7 +365,7 @@ module OpenSSL::TestPairM
assert called, 'ecdh callback should be called'
ensure
- th.join
+ th.join if th
s1.close if s1
s2.close if s2
sock1.close if sock1
@@ -413,7 +413,7 @@ module OpenSSL::TestPairM
assert_includes([s1, :wait_readable, :wait_writable ], rv)
end
ensure
- th.join
+ th.join if th
s1.close if s1
s2.close if s2
sock1.close if sock1
@@ -465,7 +465,7 @@ module OpenSSL::TestPairM
s1.print "a\ndef"
assert_equal("a\n", s2.gets)
ensure
- th.join
+ th.join if th
s1.close if s1 && !s1.closed?
s2.close if s2 && !s2.closed?
sock1.close if sock1 && !sock1.closed?