Skip to content

Random test failure on jruby #3451

Closed
Closed

Description

@deivid-rodriguez

We've been getting this for a while. I skipped the tests and the reenabled them again since I thought it was fixed. It's not apparently.

Good news is that the error message is now a bit more informative.

This is the failure:

NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.gemspec:18.
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/specifications/default/json-2.2.0-java.gemspec:18.
Coverage may be inaccurate; set the "--debug" command line option, or do JRUBY_OPTS="--debug" or set the "debug.fullTrace=true" option in your .jrubyrc
/home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/simplecov-0.17.1/lib/simplecov.rb:53: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
Skipping `gem cert` tests on jruby.
Skipping Gem::Security tests on jruby.
Run options: --seed 50509

# Running:

/home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/https.rb:50: warning: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
/home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/https.rb:50: warning: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
warning: thread "Ruby-0-Thread-731: /home/runner/work/rubygems/rubygems/test/rubygems/test_gem_remote_fetcher.rb:1077" terminated with exception (report_on_exception is true):
...........................................................................................................................................................................................................................................................S..S..S..............................................S....................................S...SS.....................................................................................................................................S.................................SS........................................................................................................................S...............................................................S............................................................S........................................................S.....S.........S.........................................S..S...................................................................S............S......S.........S...................................S.........................................................................................................S.........................................S...............................S.....................................................................................................................................................ERROR during server thread: Bad file descriptor - No message available
Errno::EBADF: Bad file descriptor - No message available
                  close at org/jruby/RubyIO.java:1990
                   each at org/jruby/RubyArray.java:1809
  cleanup_shutdown_pipe at /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:341
                  start at /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:204
                  start at /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:32
                  start at /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:157
       start_ssl_server at /home/runner/work/rubygems/rubygems/test/rubygems/test_gem_remote_fetcher.rb:1079
/home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/https.rb:50: warning: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
/home/runner/work/rubygems/rubygems/lib/rubygems/util.rb:61: warning: system does not support options in JRuby yet: {:out=>"/dev/null", :err=>[:child, :out]}
/home/runner/work/rubygems/rubygems/lib/rubygems/util.rb:61: warning: system does not support options in JRuby yet: {:out=>"/dev/null", :err=>[:child, :out]}
E..........................S...S.S...S....................S.......................................................................................................................................................................................................................................................................................................................................................................................................................SS.........................S...........................................................................................S..S...........................................................................................

Finished in 232.030057s, 8.7187 runs/s, 26.5095 assertions/s.

  1) Error:
TestGemRemoteFetcher#test_do_not_allow_invalid_client_cert_auth_connection:
Errno::EBADF: Bad file descriptor - No message available
    org/jruby/RubyIO.java:1990:in `close'
    org/jruby/RubyArray.java:1809:in `each'
    /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:341:in `cleanup_shutdown_pipe'
    /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:204:in `block in start'
    /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:32:in `start'
    /home/runner/.rubies/jruby-9.2.11.0/lib/ruby/gems/shared/gems/webrick-1.6.0/lib/webrick/server.rb:157:in `start'
    /home/runner/work/rubygems/rubygems/test/rubygems/test_gem_remote_fetcher.rb:1079:in `block in start_ssl_server'

2023 runs, 6151 assertions, 0 failures, 1 errors, 36 skips

You have skipped tests. Run with --verbose for details.
Coverage report generated for Unit Tests to /home/runner/work/rubygems/rubygems/coverage. 0 / 9077 LOC (0.0%) covered.
SimpleCov failed with exit 1rake aborted!
Command failed with status (1)

More in this sample failing CI run: https://github.com/rubygems/rubygems/runs/539821129.

I guess we can skip this again, but I'd like to report the issue to jruby first. I'll try to do that tomorrow and link it to this ticket.

This issue is related to:

  • Network problems
  • Installing a library
  • Publishing a library
  • The command line gem
  • Other

I will abide by the code of conduct.

Activity

  1. deivid-rodriguez commented on Apr 5, 2020

    @deivid-rodriguez
    ContributorAuthor
  2. deivid-rodriguez commented on Apr 10, 2020

    @deivid-rodriguez
    ContributorAuthor

    It happened again, but on a different test of the same file: https://github.com/rubygems/rubygems/pull/3506/checks?check_run_id=577376490.

  3. deivid-rodriguez commented on Apr 24, 2020

    @deivid-rodriguez
    ContributorAuthor

    Setting this as blocked until webrick supports jruby.

  4. eregon commented on May 27, 2020

    @eregon
    Member

    This looks like the typical race in WEBrick during shutdown, where both the server thread and the thread calling shutdown try to close the same pipe, which can result in EBADF (or worse, writing to the wrong fd!). On MRI it's an IOError instead because (I think) the GIL enforces close to happen one after another.

    I think we need to fix this in webrick upstream, that shutdown pattern seems fundamentally broken.

    cc @ioquatix who also saw this recently
    cc @headius who probably already saw this bug

  5. deivid-rodriguez commented on Jul 1, 2020

    @deivid-rodriguez
    ContributorAuthor

    I'll close this ticket since we've been skipping these specs since #3507. We can try unskip them once jruby fully supports webrick.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions