1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2018-05-31 07:10:39 +00:00
parent 83b14c26aa
commit a6273888a3

View file

@ -594,7 +594,7 @@ class TestRubyOptions < Test::Unit::TestCase
sleep 0.1 sleep 0.1
ps = `#{PSCMD.join(' ')} #{pid}` ps = `#{PSCMD.join(' ')} #{pid}`
break if /hello world/ =~ ps break if /hello world/ =~ ps
end while Process.wait(pid, Process::WNOHANG) end until Process.wait(pid, Process::WNOHANG)
assert_match(/hello world/, ps) assert_match(/hello world/, ps)
Process.kill :KILL, pid Process.kill :KILL, pid
Process.wait(pid) Process.wait(pid)
@ -620,7 +620,7 @@ class TestRubyOptions < Test::Unit::TestCase
sleep 0.1 sleep 0.1
ps = `#{PSCMD.join(' ')} #{pid}` ps = `#{PSCMD.join(' ')} #{pid}`
break if /hello world/ =~ ps break if /hello world/ =~ ps
end while Process.wait(pid, Process::WNOHANG) end until Process.wait(pid, Process::WNOHANG)
assert_match(/hello world/, ps) assert_match(/hello world/, ps)
Process.kill :KILL, pid Process.kill :KILL, pid
Process.wait(pid) Process.wait(pid)