ruby-changes:53097
From: k0kubun <ko1@a...>
Date: Tue, 23 Oct 2018 00:49:28 +0900 (JST)
Subject: [ruby-changes:53097] k0kubun:r65311 (trunk): revisit more MJIT test skips
k0kubun 2018-10-23 00:49:22 +0900 (Tue, 23 Oct 2018) New Revision: 65311 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65311 Log: revisit more MJIT test skips r65308 passed both trunk-mjit and trunk-mjit-wait CIs. MJIT copy job looks working fine. Then this commit skips 5 more tests. Some of them were skipped in a very early stage and may still need to be skipped, but I want to confirm them since they haven't been changed for a long time. And this prefers having inline information on `RubyVM::MJIT.enabled?`. This commit makes it easier to confirm whether there's suspicious test skip by RubyVM::MJIT.enabled? or not. After this commit, tentatively we're not skipping tests for MJIT other than `assert_no_memory_leak` ones. Modified files: trunk/test/-ext-/gvl/test_last_thread.rb trunk/test/lib/jit_support.rb trunk/test/lib/minitest/unit.rb trunk/test/ruby/test_io.rb trunk/test/ruby/test_process.rb trunk/test/ruby/test_rubyoptions.rb trunk/test/ruby/test_thread_cv.rb trunk/test/rubygems/test_gem_util.rb Index: test/ruby/test_process.rb =================================================================== --- test/ruby/test_process.rb (revision 65310) +++ test/ruby/test_process.rb (revision 65311) @@ -1614,7 +1614,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1614 Process.wait pid assert sig_r.wait_readable(5), 'self-pipe not readable' end - if RubyVM::MJIT.enabled? # MJIT may trigger extra SIGCHLD + if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD. assert_equal [true], signal_received.uniq, "[ruby-core:19744]" else assert_equal [true], signal_received, "[ruby-core:19744]" Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 65310) +++ test/ruby/test_rubyoptions.rb (revision 65311) @@ -8,7 +8,7 @@ require_relative '../lib/jit_support' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L8 class TestRubyOptions < Test::Unit::TestCase NO_JIT_DESCRIPTION = - if RubyVM::MJIT.enabled? + if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE RUBY_DESCRIPTION.sub(/\+JIT /, '') else RUBY_DESCRIPTION @@ -117,7 +117,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L117 def test_verbose assert_in_out_err(["-vve", ""]) do |r, e| assert_match(VERSION_PATTERN, r[0]) - if RubyVM::MJIT.enabled? && !mjit_force_enabled? + if RubyVM::MJIT.enabled? && !mjit_force_enabled? # checking -DMJIT_FORCE_ENABLE assert_equal(NO_JIT_DESCRIPTION, r[0]) else assert_equal(RUBY_DESCRIPTION, r[0]) @@ -180,7 +180,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L180 def test_version assert_in_out_err(%w(--version)) do |r, e| assert_match(VERSION_PATTERN, r[0]) - if RubyVM::MJIT.enabled? + if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE assert_equal(EnvUtil.invoke_ruby(['-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0]) else assert_equal(RUBY_DESCRIPTION, r[0]) @@ -210,7 +210,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L210 ].each do |args| assert_in_out_err(args) do |r, e| assert_match(VERSION_PATTERN_WITH_JIT, r[0]) - if RubyVM::MJIT.enabled? + if RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE assert_equal(RUBY_DESCRIPTION, r[0]) else assert_equal(EnvUtil.invoke_ruby(['--jit', '-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0]) Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 65310) +++ test/ruby/test_io.rb (revision 65311) @@ -548,8 +548,6 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L548 if have_nonblock? def test_copy_stream_no_busy_wait - # JIT has busy wait on GC. It's hard to test this with JIT. - skip "MJIT has busy wait on GC. We can't test this with JIT." if RubyVM::MJIT.enabled? skip "multiple threads already active" if Thread.list.size > 1 msg = 'r58534 [ruby-core:80969] [Backport #13533]' @@ -2147,12 +2145,6 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2145 end def test_autoclose_true_closed_by_finalizer - if RubyVM::MJIT.enabled? - # This is skipped but this test passes with AOT mode. - # At least it should not be a JIT compiler's bug. - skip "MJIT worker does IO which is unexpected for this test" - end - feature2250 = '[ruby-core:26222]' pre = 'ft2250' t = Tempfile.new(pre) Index: test/ruby/test_thread_cv.rb =================================================================== --- test/ruby/test_thread_cv.rb (revision 65310) +++ test/ruby/test_thread_cv.rb (revision 65311) @@ -33,8 +33,6 @@ class TestThreadConditionVariable < Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread_cv.rb#L33 end def test_condvar_wait_exception_handling - skip "MJIT thread is unexpected for this test, especially with --jit-wait" if RubyVM::MJIT.enabled? - # Calling wait in the only thread running should raise a ThreadError of # 'stopping only thread' mutex = Mutex.new Index: test/lib/minitest/unit.rb =================================================================== --- test/lib/minitest/unit.rb (revision 65310) +++ test/lib/minitest/unit.rb (revision 65311) @@ -956,7 +956,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L956 puts if @verbose $stdout.flush - unless defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # compiler process is wrongly considered as leaked + unless defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # compiler process is wrongly considered as leak leakchecker.check("#{inst.class}\##{inst.__name__}") end Index: test/lib/jit_support.rb =================================================================== --- test/lib/jit_support.rb (revision 65310) +++ test/lib/jit_support.rb (revision 65311) @@ -42,7 +42,7 @@ module JITSupport https://github.com/ruby/ruby/blob/trunk/test/lib/jit_support.rb#L42 end def remove_mjit_logs(stderr) - if RubyVM::MJIT.enabled? + if RubyVM::MJIT.enabled? # utility for -DFORCE_MJIT_ENABLE stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '') else stderr Index: test/rubygems/test_gem_util.rb =================================================================== --- test/rubygems/test_gem_util.rb (revision 65310) +++ test/rubygems/test_gem_util.rb (revision 65311) @@ -5,7 +5,6 @@ require 'rubygems/util' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_util.rb#L5 class TestGemUtil < Gem::TestCase def test_class_popen - skip "MJIT executes process and it's caught by Process.wait(-1)" if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-I', File.expand_path('../../../lib', __FILE__), '-e', 'p 0') assert_raises Errno::ECHILD do Index: test/-ext-/gvl/test_last_thread.rb =================================================================== --- test/-ext-/gvl/test_last_thread.rb (revision 65310) +++ test/-ext-/gvl/test_last_thread.rb (revision 65311) @@ -3,10 +3,6 @@ class TestLastThread < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/-ext-/gvl/test_last_thread.rb#L3 # [Bug #11237] def test_last_thread - if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? - skip 'spurious wakeup unavoidable with MJIT' - end - assert_separately([], <<-"end;") #do require '-test-/gvl/call_without_gvl' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/