Skip to content

v0.8.0 is not working with JRuby #251

Closed

Description

@hsbt

From ruby/rubygems#9089 (comment)

JRuby 10.0.2.0 and net-http 0.7.0 is working with some failures:

$ rake test
...
180 tests, 835 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications

But net-http 0.8.0 is stucking while rake test.

I found this is caued by #224.

It means rubygems can't update vendored library in the future.

@shioimm @osyoyu Can you look that?

Activity

  1. osyoyu commented on Dec 8, 2025

    @osyoyu
    Contributor

    Thanks for the report. I'll take a look tonight.

  2. eregon commented on Dec 8, 2025

    @eregon
    Member

    #252 seems to fix that, in that on net-http master with jruby 10.0.2.0, bundle exec rake test hangs but on my branch it does not hang and gives:

    ==============================================================================================================================
    Failure: test_read_body_body_encoding_false(HTTPResponseTest)
    /home/eregon/code/net-http/test/net/http/test_httpresponse.rb:76:in 'test_read_body_body_encoding_false'
         73:     end
         74: 
         75:     assert_equal "hello\u1234".b, body
      => 76:     assert_equal Encoding::ASCII_8BIT, body.encoding
         77:   end
         78: 
         79:   def test_read_body_body_encoding_encoding
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    <#<Encoding:BINARY (ASCII-8BIT)>> expected but was
    <#<Encoding:UTF-8>>
    
    diff:
    ? #<Encoding:BINARY (ASCII-8BIT)>
    ?            UTF                 
    ?            ?????????????            ---- 
    ==============================================================================================================================
    F
    ==============================================================================================================================
    Failure: test_read_body_body_encoding_true_without_content_type_header(HTTPResponseTest)
    /home/eregon/code/net-http/test/net/http/test_httpresponse.rb:145:in 'test_read_body_body_encoding_true_without_content_type_header'
         142:     end
         143: 
         144:     assert_equal "hello\u1234".b, body
      => 145:     assert_equal Encoding::ASCII_8BIT, body.encoding
         146:   end
         147: 
         148:   def test_read_body_body_encoding_true_with_utf8_content_type_header
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    <#<Encoding:BINARY (ASCII-8BIT)>> expected but was
    <#<Encoding:UTF-8>>
    
    diff:
    ? #<Encoding:BINARY (ASCII-8BIT)>
    ?            UTF                 
    ?            ?????????????            ---- 
    ==============================================================================================================================
    F
    ==============================================================================================================================
    Failure: test_session_reuse_but_expire(TestNetHTTPS)
    /home/eregon/code/net-http/test/net/http/test_https.rb:184:in 'test_session_reuse_but_expire'
         181:     http.get("/")
         182: 
         183:     socket = http.instance_variable_get(:@socket).io
      => 184:     assert_equal false, socket.session_reused?, "NOTE: OpenSSL library version is #{OpenSSL::OPENSSL_LIBRARY_VERSION}"
         185: 
         186:     http.finish
         187:   end
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyArray.java:2088:in 'each'
    org/jruby/RubyKernel.java:1397:in 'catch'
    org/jruby/RubyKernel.java:1392:in 'catch'
    NOTE: OpenSSL library version is JRuby-OpenSSL 0.15.4
    <false> expected but was
    <nil>
    
    diff:
    ? false
    ? ni   
    ? ?? --
    ==============================================================================================================================
    Finished in 17.328888 seconds.
    ------------------------------------------------------------------------------------------------------------------------------
    180 tests, 835 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
    98.3333% passed
    ------------------------------------------------------------------------------------------------------------------------------
    
  3. eregon commented on Dec 8, 2025

    @eregon
    Member

    cc @headius in case you want to add JRuby in CI to avoid such regressions and look/omit these failures

  4. osyoyu commented on Dec 9, 2025

    @osyoyu
    Contributor

    Found out that the hanging tests are the two in test_https.rb.
    https://github.com/ruby/net-http/blob/e5d4b0392b7e7b6a98a7e01b0f6715535cd341a3/test/net/http/test_https.rb

    I'm still unsure how #224 could cause tests to hang, but I'm ok with fixing it in #252.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions