From e5482df7613b2400f0897f698050ad460b3f5a7b Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 16 Feb 2009 13:44:27 +0000 Subject: 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 git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@22347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/rinda/test_rinda.rb | 22 ++++++++++++---------- version.h | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 047b12fe3..cea9678f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 16 22:42:50 2009 Masatoshi SEKI + + * test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119]. + thanks, shinichiro.h. + Mon Feb 16 22:21:20 2009 Masatoshi SEKI * lib/drb/drb.rb (DRbConn::alive?): fixed NoMethodError problem diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index 553d3078f..8ec7f0bc0 100644 --- a/test/rinda/test_rinda.rb +++ b/test/rinda/test_rinda.rb @@ -312,8 +312,8 @@ module TupleSpaceTestModule 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) @@ -342,19 +342,19 @@ module TupleSpaceTestModule 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 @@ -383,14 +383,16 @@ module TupleSpaceTestModule @ts.take({"message"=>"first", "name"=>"3"}) sleep(4) + # 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(10, taker.value) 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], listener1.value) assert_equal([0, 3], listener2.value) diff --git a/version.h b/version.h index 21e40e362..4d4b8827b 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-02-16" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20090216 -#define RUBY_PATCHLEVEL 333 +#define RUBY_PATCHLEVEL 334 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit