You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this message when running tests in 9K, but not in 1.7:
BUG: $! and exception are not matching up.
$!: org.jruby.exceptions.RaiseException: (RuntimeError) bork
t : org.jruby.exceptions.RaiseException: (RuntimeError) bork
I've narrowed it down and can trigger the message with the following code:
beginexecutor=java.util.concurrent.Executors.new_single_thread_executorfuture=executor.submit{raise'bork'}future.getrescue=>e# e is an ExecutionException, which wraps a org.jruby.exceptions.RaiseException,# which wraps the actual Ruby exceptionraisee.causeend
Running that code with rspec code.rb in JRuby 9K prints the message 12 times, running it with ruby code.rb in JRuby 9K, or rspec code.rb in JRuby 1.7 does not. There's nothing in the code that actually refers to RSpec so it must be caused by something that RSpec does that works differently in 1.7 and 9K, and at first I thought it was a message from RSpec, but I found the JRuby code that prints the message:
should this really print directly to stderr? Shouldn't it go to the logger? Also, from the message it prints it looks like the exceptions are the same. It's also weird that the message gets printed 12 times, even though the exception is only raised once.
The text was updated successfully, but these errors were encountered:
It is not rspec related. I think the exception obj is getting cloned somewhere on the way between the java->ruby bridge and the VM. The reason it is printing 12 times is because the exception is unwinding the call stack and in each scope, the interpreter is checking whether they match up ( and of course, they won't ).
BUG: $! and exception are not matching up.
$!: org.jruby.exceptions.RaiseException: (RuntimeError) bork
$!.class: org.jruby.java.proxies.ConcreteJavaProxy
Unwrapped RaiseException : bork
Unwrapped RaiseException .class: org.jruby.RubyException
They don't match up because of the proxy wrapping for java exceptions which is why you are catching and rethrowing in that rescue handler. That check was meant to detect bugs in the runtime and VM .. but, so far we haven't had any other reports besides yours (which turns out to be all fine). So, I am going to get rid of that test and be done with it.
I'm getting this message when running tests in 9K, but not in 1.7:
I've narrowed it down and can trigger the message with the following code:
Running that code with
rspec code.rb
in JRuby 9K prints the message 12 times, running it withruby code.rb
in JRuby 9K, orrspec code.rb
in JRuby 1.7 does not. There's nothing in the code that actually refers to RSpec so it must be caused by something that RSpec does that works differently in 1.7 and 9K, and at first I thought it was a message from RSpec, but I found the JRuby code that prints the message:jruby/core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Lines 609 to 613 in 0aef21d
should this really print directly to stderr? Shouldn't it go to the logger? Also, from the message it prints it looks like the exceptions are the same. It's also weird that the message gets printed 12 times, even though the exception is only raised once.
The text was updated successfully, but these errors were encountered: