[前][次][番号順一覧][スレッド一覧]

ruby-changes:32544

From: nobu <ko1@a...>
Date: Thu, 16 Jan 2014 08:19:08 +0900 (JST)
Subject: [ruby-changes:32544] nobu:r44623 (trunk): test_rinda.rb: timeout

nobu	2014-01-16 08:18:59 +0900 (Thu, 16 Jan 2014)

  New Revision: 44623

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44623

  Log:
    test_rinda.rb: timeout
    
    * test/rinda/test_rinda.rb (test_do_reply): stop if blocking
      including TupleSpace#write and RingServer#do_reply.

  Modified files:
    trunk/test/rinda/test_rinda.rb
Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 44622)
+++ test/rinda/test_rinda.rb	(revision 44623)
@@ -567,6 +567,11 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L567
 
     callback = DRb::DRbObject.new callback
 
+    th = Thread.new(Thread.current) do |mth|
+      sleep 15
+      mth.raise unless called
+    end
+
     @ts.write [:lookup_ring, callback]
 
     @rs.do_reply
@@ -580,6 +585,8 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L585
     end
 
     assert_same @ts, called
+  ensure
+    th.kill if th
   end
 
   def test_do_reply_local

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]