diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-04 15:08:56 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-04 15:08:56 +0000 |
commit | df4a126d65e4690e9301392974fcc9adf7d4c474 (patch) | |
tree | b7e28720d8dcdc42a4c4a0b607e29401d3e6aa62 /test | |
parent | 0f24cdec9ed4a2023b682e7cd5492b1602100b09 (diff) | |
download | ruby-df4a126d65e4690e9301392974fcc9adf7d4c474.tar.gz |
Revert r63758 and related commits
The change is unstable on Windows. Please re-commit it when it correctly
supports Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_optimization.rb | 2 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 12 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 17 |
3 files changed, 11 insertions, 20 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 32bdcef13d..6bfaf11d7f 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -707,7 +707,7 @@ class TestRubyOptimization < Test::Unit::TestCase end def test_clear_unreachable_keyword_args - assert_separately [], <<-END, timeout: 30 + assert_separately [], <<-END, timeout: 20 script = <<-EOS if true else diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 6a32702b03..36ae94908a 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1426,6 +1426,7 @@ class TestProcess < Test::Unit::TestCase end def test_wait_without_arg + skip "[Bug #14867]" if RubyVM::MJIT.enabled? with_tmpchdir do write_file("foo", "sleep 0.1") pid = spawn(RUBY, "foo") @@ -1434,6 +1435,7 @@ class TestProcess < Test::Unit::TestCase end def test_wait2 + skip "[Bug #14867]" if RubyVM::MJIT.enabled? with_tmpchdir do write_file("foo", "sleep 0.1") pid = spawn(RUBY, "foo") @@ -1442,6 +1444,7 @@ class TestProcess < Test::Unit::TestCase end def test_waitall + skip "[Bug #14867]" if RubyVM::MJIT.enabled? with_tmpchdir do write_file("foo", "sleep 0.1") ps = (0...3).map { spawn(RUBY, "foo") }.sort @@ -1456,9 +1459,7 @@ class TestProcess < Test::Unit::TestCase def test_wait_exception bug11340 = '[ruby-dev:49176] [Bug #11340]' t0 = t1 = nil - sec = 3 - code = "puts;STDOUT.flush;Thread.start{gets;exit};sleep(#{sec})" - IO.popen([RUBY, '-e', code], 'r+') do |f| + IO.popen([RUBY, '-e', 'puts;STDOUT.flush;Thread.start{gets;exit};sleep(3)'], 'r+') do |f| pid = f.pid f.gets t0 = Time.now @@ -1472,11 +1473,10 @@ class TestProcess < Test::Unit::TestCase th.kill.join end t1 = Time.now - diff = t1 - t0 - assert_operator(diff, :<, sec, - ->{"#{bug11340}: #{diff} seconds to interrupt Process.wait"}) f.puts end + assert_operator(t1 - t0, :<, 3, + ->{"#{bug11340}: #{t1-t0} seconds to interrupt Process.wait"}) end def test_abort diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index edd44ca0ae..d67cdcb984 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -1,7 +1,6 @@ # -*- coding: us-ascii -*- require 'test/unit' -require 'timeout' require 'tmpdir' require 'tempfile' require_relative '../lib/jit_support' @@ -591,18 +590,14 @@ class TestRubyOptions < Test::Unit::TestCase pid = spawn(EnvUtil.rubybin, "test-script") ps = nil - now = Process.clock_gettime(Process::CLOCK_MONOTONIC) - stop = now + 30 begin sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - now = Process.clock_gettime(Process::CLOCK_MONOTONIC) - end until Process.wait(pid, Process::WNOHANG) || now > stop + end until Process.wait(pid, Process::WNOHANG) assert_match(/hello world/, ps) - assert_operator now, :<, stop Process.kill :KILL, pid - Timeout.timeout(5) { Process.wait(pid) } + Process.wait(pid) end end @@ -621,18 +616,14 @@ class TestRubyOptions < Test::Unit::TestCase pid = spawn(EnvUtil.rubybin, "test-script") ps = nil - now = Process.clock_gettime(Process::CLOCK_MONOTONIC) - stop = now + 30 begin sleep 0.1 ps = `#{PSCMD.join(' ')} #{pid}` break if /hello world/ =~ ps - now = Process.clock_gettime(Process::CLOCK_MONOTONIC) - end until Process.wait(pid, Process::WNOHANG) || now > stop + end until Process.wait(pid, Process::WNOHANG) assert_match(/hello world/, ps) - assert_operator now, :<, stop Process.kill :KILL, pid - Timeout.timeout(5) { Process.wait(pid) } + Process.wait(pid) end end |