From a6273888a36bf068d39d31e5960b8c785732252a Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 31 May 2018 07:10:39 +0000 Subject: [PATCH] fix the condition * test/ruby/test_rubyoptions.rb: Process.wait with WNOHANG returns nil while the target process is alive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rubyoptions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 86b6022b82..d67cdcb984 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -594,7 +594,7 @@ class TestRubyOptions < Test::Unit::TestCase sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - end while Process.wait(pid, Process::WNOHANG) + end until Process.wait(pid, Process::WNOHANG) assert_match(/hello world/, ps) Process.kill :KILL, pid Process.wait(pid) @@ -620,7 +620,7 @@ class TestRubyOptions < Test::Unit::TestCase sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - end while Process.wait(pid, Process::WNOHANG) + end until Process.wait(pid, Process::WNOHANG) assert_match(/hello world/, ps) Process.kill :KILL, pid Process.wait(pid)