ruby-changes:10782
From: shyouhei <ko1@a...>
Date: Mon, 16 Feb 2009 22:46:13 +0900 (JST)
Subject: [ruby-changes:10782] Ruby:r22349 (ruby_1_8_7): merge revision(s) 20276:20279:
shyouhei 2009-02-16 22:46:04 +0900 (Mon, 16 Feb 2009) New Revision: 22349 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22349 Log: merge revision(s) 20276:20279: * test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119]. thanks, shinichiro.h. * test/rinda/test_rinda.rb (test_core_03_notify): Fixed test failures Modified files: branches/ruby_1_8_7/ChangeLog branches/ruby_1_8_7/test/rinda/test_rinda.rb branches/ruby_1_8_7/version.h Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 22348) +++ ruby_1_8_7/ChangeLog (revision 22349) @@ -1,3 +1,8 @@ +Mon Feb 16 22:45:41 2009 Masatoshi SEKI <m_seki@m...> + + * test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119]. + thanks, shinichiro.h. + Mon Feb 16 22:36:37 2009 Masatoshi SEKI <m_seki@m...> * lib/drb/drb.rb (DRbConn::alive?): fixed NoMethodError problem Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 22348) +++ ruby_1_8_7/version.h (revision 22349) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-16" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20090216 -#define RUBY_PATCHLEVEL 119 +#define RUBY_PATCHLEVEL 120 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_7/test/rinda/test_rinda.rb =================================================================== --- ruby_1_8_7/test/rinda/test_rinda.rb (revision 22348) +++ ruby_1_8_7/test/rinda/test_rinda.rb (revision 22349) @@ -317,8 +317,8 @@ def test_core_03_notify notify1 = @ts.notify(nil, [:req, Integer]) - notify2 = @ts.notify(nil, [:ans, Integer], 5) - notify3 = @ts.notify(nil, {"message"=>String, "name"=>String}, 5) + notify2 = @ts.notify(nil, [:ans, Integer], 8) + notify3 = @ts.notify(nil, {"message"=>String, "name"=>String}, 8) @ts.write({"message"=>"first", "name"=>"3"}, 3) @ts.write({"message"=>"second", "name"=>"1"}, 1) @@ -347,19 +347,19 @@ result = nil lv = 0 n = 0 - notify2.each do |ev| + notify2.each do |ev, tuple| n += 1 - if ev[0] == 'write' + if ev == 'write' lv = lv + 1 - elsif ev[0] == 'take' + elsif ev == 'take' lv = lv - 1 - elsif ev[0] == 'close' + elsif ev == 'close' result = [lv, n] else break end assert(lv >= 0) - assert_equal([:ans, 10], ev[1]) + assert_equal([:ans, 10], tuple) end result end @@ -386,13 +386,15 @@ sleep(4) assert_equal(10, thread_join(taker)) + # notify2 must not expire until this @ts.take. + # sleep(4) might be short enough for the timeout of notify2 (8 secs) tuple = @ts.take([:ans, nil]) assert_equal(10, tuple[1]) assert_equal([], @ts.read_all([nil, nil])) - + notify1.cancel - sleep(3) # notify2 expired - + sleep(7) # notify2 expired (sleep(4)+sleep(7) > 8) + assert_equal([0, 11], thread_join(listener1)) assert_equal([0, 3], thread_join(listener2)) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/