summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 15:29:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-18 15:29:32 +0000
commitdf9e72b22e45b5ce05d45c05c1f6b7268a62d5d0 (patch)
tree67177a7a7835a9a19b92f7662a69ce9ed357d031 /test
parent4987e84932293f1488e192c25517cd3ff1554c8e (diff)
test_rinda.rb: use spawn
* test/rinda/test_rinda.rb (TupleSpaceProxyTest#test_take_bug_8215): use more portable spawn instead of fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rinda/test_rinda.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb
index 7791c7e523..946af97988 100644
--- a/test/rinda/test_rinda.rb
+++ b/test/rinda/test_rinda.rb
@@ -479,12 +479,15 @@ class TupleSpaceProxyTest < Test::Unit::TestCase
end
def test_take_bug_8215
- skip 'missing fork' unless have_fork?
+ require_relative '../ruby/envutil'
service = DRb.start_service(nil, @ts_base)
uri = service.uri
- take = fork do
+ args = [EnvUtil.rubybin, *%W[-rdrb/drb -rdrb/eq -rrinda/ring -rrinda/tuplespace -e]]
+
+ take = spawn(*args, <<-'end;', uri)
+ uri = ARGV[0]
DRb.start_service
ro = DRbObject.new_with_uri(uri)
ts = Rinda::TupleSpaceProxy.new(ro)
@@ -495,16 +498,17 @@ class TupleSpaceProxyTest < Test::Unit::TestCase
th.raise(Interrupt) # causes loss of the taken tuple
ts.write([:barrier, :continue])
Kernel.sleep
- end
+ end;
@ts_base.take([:barrier, :continue])
- write = fork do
+ write = spawn(*args, <<-'end;', uri)
+ uri = ARGV[0]
DRb.start_service
ro = DRbObject.new_with_uri(uri)
ts = Rinda::TupleSpaceProxy.new(ro)
ts.write([:test_take, 42])
- end
+ end;
status = Process.wait(write)