diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-16 13:44:27 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-16 13:44:27 +0000 |
commit | 0863678745ce5e8aae299efffe42ae923ae103f7 (patch) | |
tree | 2ecc2cb37a77c55a72784043070c14df51299020 | |
parent | a9130b3deb0f4d2d07363d817777c0f1c865defe (diff) | |
download | ruby-0863678745ce5e8aae299efffe42ae923ae103f7.tar.gz |
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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@22347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/rinda/test_rinda.rb | 22 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 18 insertions, 11 deletions
@@ -1,3 +1,8 @@ +Mon Feb 16 22:42:50 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> + + * test/rinda/test_rinda.rb: fixed fails occasionally [ruby-dev:37119]. + thanks, shinichiro.h. + Mon Feb 16 22:21:20 2009 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> * lib/drb/drb.rb (DRbConn::alive?): fixed NoMethodError problem diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index 553d3078fe..8ec7f0bc0a 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) @@ -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 |