-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
From CI runs at #6543, we can see https://travis-ci.com/github/jruby/jruby/jobs/477837474
And notably:
3)
Thread.handle_interrupt with :never defers interrupts until exiting the handle_interrupt block FAILED
Expected [] == [:deferred]
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:54:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
4)
Thread.handle_interrupt with :on_blocking defers interrupts until the next blocking call FAILED
Expected [:interrupted] == [:deferred]
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:59:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
5)
Thread.handle_interrupt with :immediate immediately runs pending interrupts, before the block FAILED
Failed: not reached
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:76:in `block in <main>'
org/jruby/RubyThread.java:772:in `handle_interrupt'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:75:in `block in <main>'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:78:in `block in <main>'
org/jruby/RubyThread.java:772:in `handle_interrupt'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:67:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
6)
An exception occurred during: before :each
Thread.handle_interrupt also works with suspended Fibers and does not duplicate interrupts FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:50:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
7)
An exception occurred during: before :each
Thread.handle_interrupt runs pending interrupts at the end of the block, even if there was an exception raised in the block FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:50:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
8)
An exception occurred during: before :each
Thread.handle_interrupt supports multiple pairs in the Hash FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:50:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/handle_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
9)
Thread.pending_interrupt? returns false if there are no pending interrupts, e.g., outside any Thread.handle_interrupt block FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:5:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
10)
Thread.pending_interrupt? returns true if there are pending interrupts, e.g., Thread#raise inside Thread.handle_interrupt FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:12:in `block in <main>'
org/jruby/RubyThread.java:772:in `handle_interrupt'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:11:in `block in <main>'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:22:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:3:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
11)
Thread#pending_interrupt? returns whether the given threads has pending interrupts FAILED
Expected true == false
to be truthy but was false
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:30:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/pending_interrupt_spec.rb:28:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
12)
Thread#report_on_exception= when used in conjunction with Thread#abort_on_exception first reports then send the exception back to the main Thread ERROR
Expected RuntimeError (Thread#report_on_exception specs)
but got: RuntimeError (interrupt immediate)
org/jruby/ext/thread/Mutex.java:155:in `sleep'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/report_on_exception_spec.rb:97:in `block in <main>'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/report_on_exception_spec.rb:98:in `block in <main>'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/report_on_exception_spec.rb:99:in `block in <main>'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:4626:in `all?'
org/jruby/RubyArray.java:1830:in `each'
org/jruby/RubyArray.java:1830:in `each'
/home/travis/build/jruby/jruby/spec/ruby/core/thread/report_on_exception_spec.rb:47:in `<main>'
org/jruby/RubyKernel.java:1049:in `load'
org/jruby/RubyBasicObject.java:2686:in `instance_exec'
org/jruby/RubyArray.java:1830:in `each'
13)
Fiber#transfer raises a LocalJumpError if the block includes a break statement ERROR
Expected LocalJumpError
but got: RuntimeError (Thread#report_on_exception specs)
/home/travis/build/jruby/jruby/spec/ruby/core/thread/report_on_exception_spec.rb:93:in `block in <main>'
What is worrying is the failures 12 and 13.
Those actually got an exception from a previous spec, which seems like it could potentially fail random specs due to not handling Thread.handle_interrupt correctly.
Probably JRuby needs to check for pending interrupts just before & after the Thread.handle_interrupt block, as TruffleRuby does (MRI seems as well, but I didn't check the source) and as the specs illustrate.
cc @headius
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels