summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-06 12:31:59 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-06 12:31:59 +0000
commit237c2211e6e62c069bef97ef99179a2d765441eb (patch)
treeb612159002fe99ba0a77b2f37a67fbca6df982f3
parent332e8fe51f0ba4107c6fef4957ddeb15a0681dec (diff)
* test/net/imap/test_imap.rb (test_exception_during_idle): use timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/net/imap/test_imap.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index 882487881d5..f1471c0d0b2 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -215,16 +215,25 @@ class IMAPTest < Test::Unit::TestCase
begin
th = Thread.current
m = Monitor.new
+ in_idle = false
+ exception_raised = false
c = m.new_cond
Thread.start do
m.synchronize do
- c.wait
+ until in_idle
+ c.wait(0.1)
+ end
end
th.raise(Interrupt)
+ exception_raised = true
end
imap.idle do |res|
m.synchronize do
+ in_idle = true
c.signal
+ until exception_raised
+ c.wait(0.1)
+ end
end
end
rescue Interrupt