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

ruby-changes:32537

From: naruse <ko1@a...>
Date: Wed, 15 Jan 2014 17:27:03 +0900 (JST)
Subject: [ruby-changes:32537] naruse:r44616 (trunk): add timeout to test_do_reply

naruse	2014-01-15 17:26:52 +0900 (Wed, 15 Jan 2014)

  New Revision: 44616

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

  Log:
    add timeout to test_do_reply
    
    http://fb64b.rubyci.org/~chkbuild/ruby-trunk/log/20140115T073301Z.log.html.gz

  Modified files:
    trunk/test/rinda/test_rinda.rb
Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 44615)
+++ test/rinda/test_rinda.rb	(revision 44616)
@@ -4,7 +4,7 @@ require 'drb/drb' https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L4
 require 'drb/eq'
 require 'rinda/ring'
 require 'rinda/tuplespace'
-
+require 'timeout'
 require 'singleton'
 
 module Rinda
@@ -571,7 +571,13 @@ class TestRingServer < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L571
 
     @rs.do_reply
 
-    Thread.pass until called
+    t = 10 + Process.clock_gettime(Process::CLOCK_MONOTONIC, :second)
+    until called
+      if t < Process.clock_gettime(Process::CLOCK_MONOTONIC, :second)
+        flunk "timeout during waiting call"
+      end
+      Thread.pass
+    end
 
     assert_same @ts, called
   end

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

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