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

ruby-changes:25789

From: kosaki <ko1@a...>
Date: Mon, 26 Nov 2012 10:58:04 +0900 (JST)
Subject: [ruby-changes:25789] kosaki:r37846 (trunk): * test/ruby/test_process.rb (test_setsid): added a few wait for

kosaki	2012-11-26 10:57:41 +0900 (Mon, 26 Nov 2012)

  New Revision: 37846

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

  Log:
    * test/ruby/test_process.rb (test_setsid): added a few wait for
      preventing that Process.getsid(io.pid) makes Errno::ESRCH.
      (refix r37844)

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37845)
+++ ChangeLog	(revision 37846)
@@ -1,8 +1,7 @@
-Mon Nov 26 01:54:26 2012  CHIKANAGA Tomoyuki  <nagachika@r...>
+Mon Nov 26 10:50:19 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
-	* 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  <h.shirosaki@g...>
 
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 37845)
+++ test/ruby/test_process.rb	(revision 37846)
@@ -1566,13 +1566,15 @@
 	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

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

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