diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_settracefunc.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 2f0a8a7025..f1a9453ae9 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2135,6 +2135,12 @@ class TestIO < Test::Unit::TestCase 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) @@ -2150,7 +2156,7 @@ class TestIO < Test::Unit::TestCase assert_raise(Errno::EBADF, feature2250) {t.close} end ensure - t.close! + t&.close! end def test_autoclose_false_closed_by_finalizer diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 69ddc05979..bff3b8c75b 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1819,6 +1819,9 @@ class TestSetTraceFunc < Test::Unit::TestCase } # it is dirty hack. usually we shouldn't use such technique Thread.pass until t.status == 'sleep' + # When MJIT thread exists, t.status becomes 'sleep' even if it does not reach m2t_q.pop. + # This sleep forces it to reach m2t_q.pop for --jit-wait. + sleep 1 if RubyVM::MJIT.enabled? t.add_trace_func proc{|ev, file, line, *args| if file == __FILE__ diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 6171c3a19e..2d84ee3a6d 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -280,6 +280,7 @@ class TestThread < Test::Unit::TestCase s += 1 end Thread.pass until t.stop? + sleep 1 if RubyVM::MJIT.enabled? # t.stop? behaves unexpectedly with --jit-wait assert_equal(1, s) t.wakeup Thread.pass while t.alive? |