Failures in test suite running on JRuby
There are a few failures during the test suite on JRuby. We will want to investigate them so we can get JRuby into CI.
Some of these may be expected failures due to behavioral differences on JRuby, like concurrency and GC differences.
-
ArgumentError in
test_bug16634: https://github.com/jruby/jruby/issues/8798 -
Connection closed during
test_05_breakandtest_07_break_18. If these are intermittent they may be a thread race or other concurrency-related failure.
Error: test_05_break(DRbTests::TestDRbAry): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1190:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
/Users/headius/work/drb/test/drb/drbtest.rb:366:in 'test_05_break'
363:
364: def test_05_break
365: ary = []
=> 366: @there.each do |x|
367: ary.push x
368: break if x == 4
369: end
Error: test_07_break_18(DRbTests::TestDRbAry): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1190:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
(eval at /Users/headius/work/drb/test/drb/drbtest.rb:382):3:in 'test_07_break_18'
Error: test_05_break(DRbTests::TestDRbSafe1): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1196:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
/Users/headius/work/drb/test/drb/drbtest.rb:366:in 'test_05_break'
363:
364: def test_05_break
365: ary = []
=> 366: @there.each do |x|
367: ary.push x
368: break if x == 4
369: end
Error: test_07_break_18(DRbTests::TestDRbSafe1): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1196:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
(eval at /Users/headius/work/drb/test/drb/drbtest.rb:382):3:in 'test_07_break_18'
Error: test_05_break(DRbTests::TestDRbUNIXAry): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1196:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
/Users/headius/work/drb/test/drb/drbtest.rb:366:in 'test_05_break'
363:
364: def test_05_break
365: ary = []
=> 366: @there.each do |x|
367: ary.push x
368: break if x == 4
369: end
Error: test_07_break_18(DRbTests::TestDRbUNIXAry): DRb::DRbConnError: connection closed
/Users/headius/work/drb/lib/drb/drb.rb:613:in 'load'
/Users/headius/work/drb/lib/drb/drb.rb:668:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:970:in 'recv_reply'
/Users/headius/work/drb/lib/drb/drb.rb:1353:in 'send_message'
/Users/headius/work/drb/lib/drb/drb.rb:1172:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1331:in 'open'
/Users/headius/work/drb/lib/drb/drb.rb:1171:in 'block in method_missing'
/Users/headius/work/drb/lib/drb/drb.rb:1196:in 'with_friend'
/Users/headius/work/drb/lib/drb/drb.rb:1170:in 'method_missing'
(eval at /Users/headius/work/drb/test/drb/drbtest.rb:382):3:in 'test_07_break_18'
- Oddity in reported name from a remote object (I think?):
Failure: test_02_unknown(DRbTests::TestDRbCore)
/Users/headius/work/drb/test/drb/drbtest.rb:177:in 'test_02_unknown'
174:
175: obj = @there.unknown_module
176: assert_kind_of(DRb::DRbUnknown, obj)
=> 177: assert_equal('DRbTests::DRbEx::', obj.name)
178:
179: assert_raise(DRb::DRbUnknownError) do
180: @there.unknown_error
org/jruby/RubyKernel.java:1397:in 'catch'
org/jruby/RubyKernel.java:1392:in 'catch'
org/jruby/RubyArray.java:2079:in 'each'
org/jruby/RubyArray.java:2079:in 'each'
org/jruby/RubyKernel.java:1397:in 'catch'
org/jruby/RubyKernel.java:1392:in 'catch'
<"DRbTests::DRbEx::"> expected but was
<"DRbTests::DRbEx::FooBar">
- Missing method on a remote object?
Failure: test_11_remote_no_method_error(DRbTests::TestDRbCore): [DRb::DRbRemoteError] exception expected, not #<NoMethodError: undefined method 'invoke_no_method' for an instance of DRbTests::DRbEx>.
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:454:in 'block in assert_raise'
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:540:in 'assert'
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:453:in 'assert_raise'
/Users/headius/work/drb/test/drb/drbtest.rb:313:in 'test_11_remote_no_method_error'
310: end
311:
312: def test_11_remote_no_method_error
=> 313: assert_raise(DRb::DRbRemoteError) do
314: @there.remote_no_method_error
315: end
316: begin
Failure: test_11_remote_no_method_error(DRbTests::TestDRbUNIXCore): [DRb::DRbRemoteError] exception expected, not #<NoMethodError: undefined method 'invoke_no_method' for an instance of DRbTests::DRbEx>.
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:454:in 'block in assert_raise'
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:540:in 'assert'
/Users/headius/work/jruby/lib/ruby/gems/shared/bundler/gems/test-unit-ruby-core-04bbdf8d1f83/lib/core_assertions.rb:453:in 'assert_raise'
/Users/headius/work/drb/test/drb/drbtest.rb:313:in 'test_11_remote_no_method_error'
310: end
311:
312: def test_11_remote_no_method_error
=> 313: assert_raise(DRb::DRbRemoteError) do
314: @there.remote_no_method_error
315: end
316: begin
- Several SSL-related tests (basically everything in
DRbTests::TestDRbSSLCore) fail withcertificate verify failedbut I'm not sure if this is a bug or some misconfiguration in JRuby's openssl support. A server in a separate thread crashes as a result and these tests then time out waiting for the server to respond.
warning: thread "Ruby-0-Thread-1: /Users/headius/work/drb/lib/drb/drb.rb:1584" terminated with exception (report_on_exception is true):NoMethodError: undefined method 'include?' for nil
accept_or_shutdown at /Users/headius/work/drb/lib/drb/drb.rb:1016
accept at /Users/headius/work/drb/lib/drb/ssl.rb:334
main_loop at /Users/headius/work/drb/lib/drb/drb.rb:1743
run at /Users/headius/work/drb/lib/drb/drb.rb:1586
DRb::DRbConnError: drbssl://localhost:52295 - #<OpenSSL::SSL::SSLError: certificate verify failed>
open at /Users/headius/work/drb/lib/drb/drb.rb:772
each at org/jruby/RubyArray.java:2079
open at /Users/headius/work/drb/lib/drb/drb.rb:765
initialize at /Users/headius/work/drb/lib/drb/drb.rb:1347
new at org/jruby/RubyClass.java:1023
open at /Users/headius/work/drb/lib/drb/drb.rb:1330
method_missing at /Users/headius/work/drb/lib/drb/drb.rb:1171
with_friend at /Users/headius/work/drb/lib/drb/drb.rb:1190
method_missing at /Users/headius/work/drb/lib/drb/drb.rb:1170
initialize at /Users/headius/work/drb/lib/drb/extserv.rb:21
synchronize at org/jruby/ext/monitor/Monitor.java:85
mon_synchronize at /Users/headius/work/jruby/lib/ruby/stdlib/monitor.rb:206
initialize at /Users/headius/work/drb/lib/drb/extserv.rb:20
new at org/jruby/RubyClass.java:1050
<main> at /Users/headius/work/drb/test/drb/ut_array_drbssl.rb:39
For DRb::DRbConnError: connection closed: It seems that JRuby doesn't raise LocalJumpError with break. I think that the following operations are done in dRuby but it doesn't reproduce this problem...:
def x(&block)
block
end
block = x do |i|
break if i == 4
end
Thread.new do
(1..5).each do |i|
Thread.new do
begin
p block.call(i)
rescue LocalJumpError
p $!
end
end.join
end
end.join
For "Oddity in reported name from a remote object (I think?)", it's CRuby and JRuby incompatibility for Marshal.load exception message:
module DRbTests
module DRbEx
class FooBar
end
end
end
data = Marshal.dump(DRbTests::DRbEx::FooBar.new)
DRbTests.__send__(:remove_const, :DRbEx)
Marshal.load(data)
CRuby:
<internal:marshal>:34:in 'Marshal.load': undefined class/module DRbTests::DRbEx:: (ArgumentError)
JRuby:
ArgumentError: undefined class/module DRbTests::DRbEx::FooBar
For "Missing method on a remote object?, it seems that JRuby doesn't call _dump for NoMethodError#args:
class Undumped
def _dump(dummy)
raise TypeError, 'can\'t dump'
end
end
Marshal.dump(NoMethodError.new("message", :nonexistent, [Undumped.new]))
CRuby raises an TypeError but JRuby doesn't raise nothing.
I ran the test suite on TruffleRuby and see similar failures: https://github.com/ruby/drb/issues/38
For
DRb::DRbConnError: connection closed: It seems that JRuby doesn't raiseLocalJumpErrorwithbreak. I think that the following operations are done in dRuby but it doesn't reproduce this problem...:
Right, that snippet seems to have the same output on all 3 Ruby implementations (except a slightly different exception message on JRuby). I hope it's not related to https://bugs.ruby-lang.org/issues/17105 which IIRC is basically impossible to implement on non-CRuby (it requires custom checks during unwinding for an exception, no such thing available on JVM).
For "Oddity in reported name from a remote object (I think?)", it's CRuby and JRuby incompatibility for
Marshal.loadexception message:
TruffleRuby has the same behavior as JRuby. How about adapting the test to allow both?
For "Missing method on a remote object?, it seems that JRuby doesn't call
_dumpforNoMethodError#args:
Same on truffleruby.
@kou Thank you for the analysis! I will read through your examples and see if they make sense to investigate further in JRuby. As @eregon pointed out, some of these also fail in TruffleRuby and CRuby, and may be subtle enough that the test or DRb should be modified.
I'm working on some fixes here: https://github.com/jruby/jruby/pull/8802
The Marshal.load error seemed worth fixing, since the intention seems to be to display the first failing segment in the class path search, rather than just displaying the whole path.
The Marshal.load error message fix is in jruby/jruby#8802.
The issue with Marshal.dump not calling _dump on the args is fixed by allowing the Java args field to be registered as a Ruby internal variable (jruby/jruby#8804). That's a work in progress since it represents a new optimization for JRuby.