ruby-changes:27813
From: naruse <ko1@a...>
Date: Thu, 21 Mar 2013 23:55:36 +0900 (JST)
Subject: [ruby-changes:27813] naruse:r39865 (trunk): Retry ps if it doesn't do setproctitle
naruse 2013-03-21 23:55:26 +0900 (Thu, 21 Mar 2013) New Revision: 39865 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39865 Log: Retry ps if it doesn't do setproctitle Modified files: trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 39864) +++ test/ruby/test_rubyoptions.rb (revision 39865) @@ -466,8 +466,12 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L466 write_file("test-script", "$0 = 'hello world'; sleep 60") pid = spawn(EnvUtil.rubybin, "test-script") - sleep 0.1 - ps = `ps -p #{pid} -o command` + ps = nil + 10.times do + sleep 0.1 + ps = `ps -p #{pid} -o command` + break if /hello world/ =~ ps + end assert_match(/hello world/, ps) Process.kill :KILL, pid end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/