diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-13 16:19:46 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-04-13 16:19:46 +0000 |
commit | 7ab4fbfefb130e156e8e47b0ffe84cf313922d49 (patch) | |
tree | 1efd548947498d0289f0c6f52d44ce50e44438e8 | |
parent | 3a22d47dfd6f2ede915bfcf66a49251a05e6baa0 (diff) | |
download | ruby-7ab4fbfefb130e156e8e47b0ffe84cf313922d49.tar.gz |
Terminate created threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/net/smtp/test_smtp.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_exception.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb index 3a9749504d..98b7cad345 100644 --- a/test/net/smtp/test_smtp.rb +++ b/test/net/smtp/test_smtp.rb @@ -162,7 +162,7 @@ module Net servers = Socket.tcp_server_sockets("localhost", 0) begin sock = nil - Thread.start do + t = Thread.start do sock = accept(servers) sock.close end @@ -176,6 +176,7 @@ module Net ensure sock.close if sock servers.each(&:close) + t.join end end diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index a6b707bcca..37b5f7068c 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -727,6 +727,8 @@ end.join end end assert_nil(e.cause) + ensure + y.join end def test_cause_thread_with_cause |