From e66f118a9bf4e727ed63003af56a028779429482 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 22 Aug 2007 03:39:26 +0000 Subject: * lib/rinda/tuplespace.rb: fix Rinda::TupleSpace keeper thread bug. the thread is started too early. [ruby-talk:264062] * test/rinda/test_rinda.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rinda/test_rinda.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/rinda') diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index d663e0446d..553d3078fe 100644 --- a/test/rinda/test_rinda.rb +++ b/test/rinda/test_rinda.rb @@ -240,6 +240,20 @@ module TupleSpaceTestModule end end + def test_ruby_talk_264062 + th = Thread.new { @ts.take([:empty], 1) } + sleep 2 + assert_raises(Rinda::RequestExpiredError) do + th.value + end + + th = Thread.new { @ts.read([:empty], 1) } + sleep 2 + assert_raises(Rinda::RequestExpiredError) do + th.value + end + end + def test_core_01 5.times do |n| @ts.write([:req, 2]) -- cgit v1.2.3