ruby-changes:51588
From: normal <ko1@a...>
Date: Sat, 30 Jun 2018 16:53:37 +0900 (JST)
Subject: [ruby-changes:51588] normal:r63799 (trunk): test/ruby/test_rubyoptions.rb: improve diagnostics for failures
normal 2018-06-30 16:53:31 +0900 (Sat, 30 Jun 2018) New Revision: 63799 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63799 Log: test/ruby/test_rubyoptions.rb: improve diagnostics for failures rubyci.org OSX CI instances seem to hang on this, but I'm not sure why... Modified files: trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 63798) +++ test/ruby/test_rubyoptions.rb (revision 63799) @@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L1 # -*- coding: us-ascii -*- require 'test/unit' +require 'timeout' require 'tmpdir' require 'tempfile' require_relative '../lib/jit_support' @@ -590,14 +591,17 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L591 pid = spawn(EnvUtil.rubybin, "test-script") ps = nil + stop = Process.clock_gettime(Process::CLOCK_MONOTONIC) + 30 begin sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - end until Process.wait(pid, Process::WNOHANG) + now = Process.clock_gettime(Process::CLOCK_MONOTONIC) + end until Process.wait(pid, Process::WNOHANG) || now > stop assert_match(/hello world/, ps) + assert_operator now, :<, stop Process.kill :KILL, pid - Process.wait(pid) + Timeout.timeout(5) { Process.wait(pid) } end end @@ -616,14 +620,17 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L620 pid = spawn(EnvUtil.rubybin, "test-script") ps = nil + stop = Process.clock_gettime(Process::CLOCK_MONOTONIC) + 30 begin sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - end until Process.wait(pid, Process::WNOHANG) + now = Process.clock_gettime(Process::CLOCK_MONOTONIC) + end until Process.wait(pid, Process::WNOHANG) || now > stop assert_match(/hello world/, ps) + assert_operator now, :<, stop Process.kill :KILL, pid - Process.wait(pid) + Timeout.timeout(5) { Process.wait(pid) } end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/