From 769781a0990a9d44f45f235086d8474a80fcc27d Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 26 Nov 2012 01:57:41 +0000 Subject: * 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 --- ChangeLog | 7 +++---- test/ruby/test_process.rb | 10 ++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f007e2cd7..65e405234e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,7 @@ -Mon Nov 26 01:54:26 2012 CHIKANAGA Tomoyuki +Mon Nov 26 10:50:19 2012 KOSAKI Motohiro - * test/ruby/test_process.rb (test_setsid): call Process.getsid for - child process in child process. because parent process call - Process.getsid with io.pid, Errno::ESRCH could be raised. + * test/ruby/test_process.rb (test_setsid): added a few wait for + preventing that Process.getsid(io.pid) makes Errno::ESRCH. Sun Nov 25 22:34:00 2012 Hiroshi Shirosaki 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 -- cgit v1.2.3