summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 06:37:28 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-06 06:37:28 +0000
commit6cd1e11d01036df2856aff996984d276a602a7cf (patch)
treede606a526752af77b47e723cda57c8ca628228fc /test
parent88903e23dd4ec7e58fe3ffb0070ec7fdcd0d6b8f (diff)
* test/ruby/test_process.rb (test_setsid): ensure to call
Process.wait(). Reported by George Koehler. Thanks. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 1e72998e17..1230778711 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1583,15 +1583,17 @@ class TestProcess < Test::Unit::TestCase
newsid = Process.setsid
Marshal.dump(newsid, STDOUT)
STDOUT.flush
- sleep 3
EOS
+ begin
+ # test Process.getsid() w/o arg
+ assert_equal(Marshal.load(io), Process.getsid)
- # test Process.getsid() w/o arg
- assert_equal(Marshal.load(io), Process.getsid)
-
- # test Process.setsid return value and Process::getsid(pid)
- assert_equal(Marshal.load(io), Process.getsid(io.pid))
- Process.kill(:KILL, io.pid)
+ # 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.wait(io.pid)
+ end
end
end