From 786e7aba7fcc1fbce5b4f8bacacf1fd008b8341f Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 5 May 2008 17:18:09 +0000 Subject: * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception. * test/net/imap/test_imap.rb: ensure disconnecting imap to terminate receiver thread.. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/io/nonblock/test_flush.rb | 1 - test/net/imap/test_imap.rb | 23 +++++++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c390e2742..aff6e53454 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue May 6 02:08:18 2008 Tanaka Akira + + * test/io/nonblock/test_flush.rb: don't set Thread.abort_on_exception. + + * test/net/imap/test_imap.rb: ensure disconnecting imap to terminate + receiver thread.. + Tue May 6 00:29:21 2008 Yukihiro Matsumoto * iseq.c (insn_operand_intern): should handle Qundef embedded in diff --git a/test/io/nonblock/test_flush.rb b/test/io/nonblock/test_flush.rb index 67ac1fcaa4..b41afe1101 100644 --- a/test/io/nonblock/test_flush.rb +++ b/test/io/nonblock/test_flush.rb @@ -5,7 +5,6 @@ begin rescue LoadError end -Thread.abort_on_exception = true class TestIONonblock < Test::Unit::TestCase def test_flush r,w = IO.pipe diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb index bc36f103e3..c164875c42 100644 --- a/test/net/imap/test_imap.rb +++ b/test/net/imap/test_imap.rb @@ -67,6 +67,7 @@ class IMAPTest < Test::Unit::TestCase end def test_starttls + imap = nil if defined?(OpenSSL) starttls_test do |port| imap = Net::IMAP.new("localhost", :port => port) @@ -74,6 +75,10 @@ class IMAPTest < Test::Unit::TestCase imap end end + ensure + if imap && !imap.disconnected? + imap.disconnect + end end private @@ -105,9 +110,12 @@ class IMAPTest < Test::Unit::TestCase end end begin - imap = yield(port) - imap.logout - imap.disconnect + begin + imap = yield(port) + imap.logout + ensure + imap.disconnect if imap + end ensure ssl_server.close end @@ -143,9 +151,12 @@ class IMAPTest < Test::Unit::TestCase end end begin - imap = yield(port) - imap.logout - imap.disconnect + begin + imap = yield(port) + imap.logout + ensure + imap.disconnect if imap + end ensure server.close end -- cgit v1.2.3