1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
shyouhei 2009-02-16 13:44:27 +00:00
parent a9130b3deb
commit 0863678745
3 changed files with 18 additions and 11 deletions

View file

@ -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

View file

@ -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)

View file

@ -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