summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-26 15:22:53 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-26 15:22:53 +0000
commit77f603cbc9e66c7847496bae97ddc4671d6d4849 (patch)
tree071b96aa66520a84af8120ecec6c5ed21f3ca7c5 /test/ruby
parent8fa5da9ae90155018a500fe92dba520f88495084 (diff)
merge revision(s) 39179,39245: [Backport #7826]
the process maybe already finished * test/ruby/test_process.rb (test_setsid): Added a workaround for MacOS X. Patch by nagachika. [Bug #7826] [ruby-core:52126] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_process.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 1230778711..6616955502 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1583,6 +1583,9 @@ class TestProcess < Test::Unit::TestCase
newsid = Process.setsid
Marshal.dump(newsid, STDOUT)
STDOUT.flush
+ # getsid() on MacOS X return ESRCH when target process is zombie
+ # even if it is valid process id.
+ sleep
EOS
begin
# test Process.getsid() w/o arg
@@ -1591,7 +1594,7 @@ EOS
# test Process.setsid return value and Process::getsid(pid)
assert_equal(Marshal.load(io), Process.getsid(io.pid))
ensure
- Process.kill(:KILL, io.pid)
+ Process.kill(:KILL, io.pid) rescue nil
Process.wait(io.pid)
end
end