Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_dispatch_1 ArgumentError (JRuby 9.4.0, RSpec report) #7630

Closed
thbar opened this issue Feb 7, 2023 · 7 comments
Closed

_dispatch_1 ArgumentError (JRuby 9.4.0, RSpec report) #7630

thbar opened this issue Feb 7, 2023 · 7 comments
Milestone

Comments

@thbar
Copy link
Contributor

thbar commented Feb 7, 2023

Environment Information

  • jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 17.0.4.1+0 on 17.0.4.1+0 +jit [arm64-darwin]
  • Darwin Thibauts-MacBook-Air.local 21.6.0 Darwin Kernel Version 21.6.0: Sun Nov 6 23:29:57 PST 2022; root:xnu-8020.240.14~1/RELEASE_ARM64_T8101 arm64

Expected Behavior

While running a test suite (RSpec), the previous version of JRuby passed our test suite.

RSpec 3.12
  - rspec-core 3.12.1
  - rspec-expectations 3.12.2
  - rspec-mocks 3.12.3
  - rspec-support 3.12.0

Actual Behavior

The test suite runs, gives a couple of failures (no problem on that), but the RSpec report is not rendered due to an exception which looks curious:

❯ bundle exec rspec          
/Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rollbar-3.3.1/lib/rollbar/json.rb:8: warning: attribute accessor as module_function
Run options: exclude {:ars_connected=>true}
...........................FFFF..FF......................................................................................................................................................................................................................................................................................FFFFFFFFFFFFFF.FF.FFFFFFFFFFFFFFFFFFF.......

bundler: failed to load command: rspec (/Users/thbar/.rbenv/versions/jruby-9.4.0.0/bin/rspec)
ArgumentError: wrong number of arguments (given 0, expected 1)
                      _dispatch_1 at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/stdlib/ripper/core.rb:40
                            parse at org/jruby/ext/ripper/RubyRipper.java:351
                            parse at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/stdlib/ripper/lexer.rb:176
                              lex at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/stdlib/ripper/lexer.rb:154
                              lex at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/stdlib/ripper/lexer.rb:52
                           tokens at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-support-3.12.0/lib/rspec/support/source.rb:64
            tokens_by_line_number at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-support-3.12.0/lib/rspec/support/source.rb:78
    unclosed_tokens_in_line_range at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/snippet_extractor.rb:72
                             each at org/jruby/RubyRange.java:590
                         flat_map at org/jruby/RubyEnumerable.java:911
                         flat_map at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/flat_map.rb:7
    unclosed_tokens_in_line_range at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/snippet_extractor.rb:71
         line_range_of_expression at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/snippet_extractor.rb:58
                 expression_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/snippet_extractor.rb:42
      extract_expression_lines_at at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/snippet_extractor.rb:31
                read_failed_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:231
        failure_slash_error_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:166
                    failure_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:153
                              tap at org/jruby/RubyKernel.java:2019
                    failure_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:152
          colorized_message_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:34
  formatted_message_and_backtrace at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:257
            fully_formatted_lines at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:88
                  fully_formatted at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/exception_presenter.rb:80
                  fully_formatted at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/notifications.rb:200
  fully_formatted_failed_examples at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/notifications.rb:114
                             each at org/jruby/RubyArray.java:1988
                  each_with_index at org/jruby/RubyEnumerable.java:1218
  fully_formatted_failed_examples at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/notifications.rb:113
                    dump_failures at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/formatters/base_text_formatter.rb:32
                           notify at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:209
                             each at org/jruby/RubyArray.java:1988
                           notify at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:208
                           finish at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:178
                      close_after at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:194
                           finish at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:174
                           report at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/reporter.rb:76
                        run_specs at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/runner.rb:115
                              run at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/runner.rb:89
                              run at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/runner.rb:71
                           invoke at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/lib/rspec/core/runner.rb:45
                           <main> at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/rspec-core-3.12.1/exe/rspec:4
                             load at org/jruby/RubyKernel.java:1091
                           <main> at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/bin/rspec:25
                             load at org/jruby/RubyKernel.java:1091
                      kernel_load at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/cli/exec.rb:58
                              run at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/cli/exec.rb:23
                             exec at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/cli.rb:484
                              run at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/vendor/thor/lib/thor/command.rb:27
                   invoke_command at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
                         dispatch at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/vendor/thor/lib/thor.rb:392
                         dispatch at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/cli.rb:31
                            start at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/vendor/thor/lib/thor/base.rb:485
                            start at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/cli.rb:25
                           <main> at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/exe/bundle:48
             with_friendly_errors at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/lib/bundler/friendly_errors.rb:103
                           <main> at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/lib/ruby/gems/shared/gems/bundler-2.3.3/exe/bundle:36
                             load at org/jruby/RubyKernel.java:1091
                           <main> at /Users/thbar/.rbenv/versions/jruby-9.4.0.0/bin/bundle:25
... 60 levels...
@thbar
Copy link
Contributor Author

thbar commented Feb 7, 2023

To clarify: I wonder if this is a form of incompatibility between JRuby 9.4.x and RSpec formatters, based on the stack trace.

@thbar thbar changed the title _dispatch_1 ArgumentError (JRuby 9.4.0) _dispatch_1 ArgumentError (JRuby 9.4.0, RSpec report) Feb 7, 2023
@headius
Copy link
Member

headius commented Feb 7, 2023

Interesting. We have rspec runs in our own repository that don't seem to have been affected. We'll have to dig into this deeper, with a newer version of rspec than we run in CI.

headius added a commit to headius/jruby that referenced this issue Feb 7, 2023
Relates to jruby#7630, which may be a new incompatibility in rspec.
@headius
Copy link
Member

headius commented Feb 7, 2023

I pushed a PR that updates the rspec we use for CI. We'll see how that goes.

@thbar If you have an example repository that reproduces the issue, let me know.

@thbar
Copy link
Contributor Author

thbar commented Feb 7, 2023

@headius I do not have an example repository currently, but I will try to provide that!

@enebo
Copy link
Member

enebo commented Feb 7, 2023

@thbar Definitely try 9.4.1.0 since I did fix multiple issues with ripper since 9.4.0.0 came out.

@headius
Copy link
Member

headius commented Feb 7, 2023

rspec 3.12 does appear to have run ok in this PR: #7631

Once we get confirmation that @thbar's case is working, I'll merge that so we're on latest rspec.

@thbar
Copy link
Contributor Author

thbar commented Feb 7, 2023

@enebo I tried 9.4.1.0 and indeed it fixes the issue with the RSpec report.

Sidenote: to install 9.4.1.0 with rbenv/ruby-build, I had to use a custom build since it's not already integrated there.

I created /opt/homebrew/Cellar/ruby-build/20230202/share/ruby-build/jruby-9.4.1.0 with content:

require_java 8
install_package "jruby-9.4.1.0" "https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.1.0/jruby-dist-9.4.1.0-bin.tar.gz" jruby

Issue solved, I will close the ticket, thanks @enebo & @headius!

@thbar thbar closed this as completed Feb 7, 2023
@headius headius added this to the JRuby 9.4.1.0 milestone Feb 7, 2023
edipofederle pushed a commit to edipofederle/jruby that referenced this issue Feb 8, 2023
Relates to jruby#7630, which may be a new incompatibility in rspec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants