[前][次][番号順一覧][スレッド一覧]

ruby-changes:27046

From: kosaki <ko1@a...>
Date: Wed, 6 Feb 2013 15:37:40 +0900 (JST)
Subject: [ruby-changes:27046] kosaki:r39098 (trunk): * test/ruby/test_process.rb (test_setsid): ensure to call

kosaki	2013-02-06 15:37:28 +0900 (Wed, 06 Feb 2013)

  New Revision: 39098

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39098

  Log:
    * test/ruby/test_process.rb (test_setsid): ensure to call
      Process.wait(). Reported by George Koehler. Thanks.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_process.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39097)
+++ ChangeLog	(revision 39098)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Feb  4 02:22:49 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* test/ruby/test_process.rb (test_setsid): ensure to call
+	  Process.wait(). Reported by George Koehler. Thanks.
+
 Mon Feb  4 02:18:00 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* test/ruby/test_process.rb (test_setsid): skip when platform is
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 39097)
+++ test/ruby/test_process.rb	(revision 39098)
@@ -1583,15 +1583,17 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1583
 	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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]