summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-21 14:55:26 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-21 14:55:26 +0000
commit035838147231983fb448b84ef5d4d08d4d3bbdf3 (patch)
tree9e226fe5777e2984e5acf04d39320e0e9d294d35 /test
parent7f7621e734dc697ab8e1f018c0013f27d77e6cbb (diff)
Retry ps if it doesn't do setproctitle
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_rubyoptions.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 8f22bdaecc..c7cda12659 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -466,8 +466,12 @@ class TestRubyOptions < Test::Unit::TestCase
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