diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-26 01:57:41 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-26 01:57:41 +0000 |
commit | 769781a0990a9d44f45f235086d8474a80fcc27d (patch) | |
tree | 762aa2e51f53cbc338bfa34b6d2ad3b3f5f36ee7 /test/ruby | |
parent | 251dbc1241ef2721abaceeebdc70428668f978f4 (diff) | |
download | ruby-769781a0990a9d44f45f235086d8474a80fcc27d.tar.gz |
* test/ruby/test_process.rb (test_setsid): added a few wait for
preventing that Process.getsid(io.pid) makes Errno::ESRCH.
(refix r37844)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_process.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index c5c9d8af79..46c194f83d 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1566,13 +1566,15 @@ class TestProcess < Test::Unit::TestCase Marshal.dump(Process.getsid, STDOUT) newsid = Process.setsid Marshal.dump(newsid, STDOUT) - Marshal.dump(Process.getsid($$), STDOUT) STDOUT.flush + sleep 3 EOS + + # test Process.getsid() w/o arg assert_equal(Marshal.load(io), Process.getsid) - newsid = Marshal.load(io) - getsid = Marshal.load(io) - assert_equal(newsid, getsid) + # test Process.setsid return value and Process::getsid(pid) + assert_equal(Marshal.load(io), Process.getsid(io.pid)) + Process.kill(:KILL, io.pid) end end end |