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

Add Rails 5+ to Active Record PG suites for JRuby #935

Closed
kaylareopelle opened this issue Feb 7, 2022 · 3 comments
Closed

Add Rails 5+ to Active Record PG suites for JRuby #935

kaylareopelle opened this issue Feb 7, 2022 · 3 comments
Labels
integration Represents tracked integration test gaps technical debt

Comments

@kaylareopelle
Copy link
Contributor

kaylareopelle commented Feb 7, 2022

Running Active Record PG tests on JRuby raised the following error on the CI for Rails 5.0, 5.1, and 5.2:

Something unusual has occurred to cause the driver to fail. Please report this exception.
arjdbc/jdbc/RubyJdbcConnection.java:557:in `initialize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/abstract/core.rb:19:in `initialize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/abstract/statement_cache.rb:21:in `initialize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/postgresql/adapter.rb:641:in `initialize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/jdbc/callbacks.rb:12:in `new'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/jdbc/connection_methods.rb:8:in `jdbc_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/postgresql/connection_methods.rb:66:in `postgresql_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:91:in `connection'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1038:in `current_version'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1273:in `last_stored_environment'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:48:in `check_protected_environments!'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:11:in `block in <main>'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
	org/jruby/RubyArray.java:1820:in `each'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:237:in `block in mon_synchronize'
	org/jruby/RubyThread.java:759:in `handle_interrupt'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:236:in `block in mon_synchronize'
	org/jruby/RubyThread.java:759:in `handle_interrupt'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:233:in `mon_synchronize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:243:in `block in invoke_prerequisites'
	org/jruby/RubyArray.java:1820:in `each'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:237:in `block in mon_synchronize'
	org/jruby/RubyThread.java:759:in `handle_interrupt'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:236:in `block in mon_synchronize'
	org/jruby/RubyThread.java:759:in `handle_interrupt'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:233:in `mon_synchronize'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/suites/active_record_pg/before_suite.rb:12:in `<main>'
	org/jruby/RubyKernel.java:974:in `require'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:631:in `block in execute_ruby_files'
	org/jruby/RubyArray.java:1820:in `each'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:628:in `execute_ruby_files'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:374:in `block in execute_child_environment'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:484:in `block in with_unbundled_env'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:313:in `block in with_clean_env'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:562:in `with_env'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:313:in `with_clean_env'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/bundler_patch.rb:15:in `with_unbundled_env'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:484:in `block in with_unbundled_env'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:107:in `with_potentially_mismatched_bundler'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:479:in `with_unbundled_env'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:360:in `execute_child_environment'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:693:in `<main>'
	org/jruby/RubyKernel.java:974:in `require'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83:in `require'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse.rb:31:in `<main>'
	org/jruby/RubyKernel.java:974:in `require'
	/home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83:in `require'
	/home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:14:in `<main>'
#<Class:0x5e268ce6>: Something unusual has occurred to cause the driver to fail. Please report this exception.
                           initialize at arjdbc/jdbc/RubyJdbcConnection.java:557
                           initialize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/abstract/core.rb:19
                           initialize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/abstract/statement_cache.rb:21
                           initialize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/postgresql/adapter.rb:641
                                  new at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/jdbc/callbacks.rb:12
                      jdbc_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/jdbc/connection_methods.rb:8
                postgresql_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-50.8-java/lib/arjdbc/postgresql/connection_methods.rb:66
                       new_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729
              checkout_new_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773
       try_to_checkout_new_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752
                   acquire_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713
                             checkout at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490
                           connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364
                  retrieve_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883
                  retrieve_connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:128
                           connection at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:91
                      current_version at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1038
              last_stored_environment at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1273
        check_protected_environments! at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/tasks/database_tasks.rb:48
                               <main> at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activerecord-5.0.7.2/lib/active_record/railties/databases.rake:11
                              execute at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281
                                 each at org/jruby/RubyArray.java:1820
                              execute at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281
               invoke_with_call_chain at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:219
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:237
                     handle_interrupt at org/jruby/RubyThread.java:759
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:236
                     handle_interrupt at org/jruby/RubyThread.java:759
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:233
               invoke_with_call_chain at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:199
                 invoke_prerequisites at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:243
                                 each at org/jruby/RubyArray.java:1820
                 invoke_prerequisites at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:241
               invoke_with_call_chain at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:218
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:237
                     handle_interrupt at org/jruby/RubyThread.java:759
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:236
                     handle_interrupt at org/jruby/RubyThread.java:759
                      mon_synchronize at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/monitor.rb:233
               invoke_with_call_chain at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:199
                               invoke at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:188
                               <main> at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/suites/active_record_pg/before_suite.rb:12
                              require at org/jruby/RubyKernel.java:974
                              require at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293
                      load_dependency at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259
                              require at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293
                   execute_ruby_files at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:631
                                 each at org/jruby/RubyArray.java:1820
                   execute_ruby_files at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:628
            execute_child_environment at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:374
                   with_unbundled_env at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:484
                       with_clean_env at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:313
                             with_env at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:562
                       with_clean_env at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/gems/shared/gems/bundler-1.17.3/lib/bundler.rb:313
                   with_unbundled_env at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/bundler_patch.rb:15
                   with_unbundled_env at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:484
  with_potentially_mismatched_bundler at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:107
                   with_unbundled_env at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:479
            execute_child_environment at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:360
                               <main> at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:693
                              require at org/jruby/RubyKernel.java:974
                              require at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83
                               <main> at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse.rb:31
                              require at org/jruby/RubyKernel.java:974
                              require at /home/runner/.rubies/ruby-jruby-9.2.19.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:83
                               <main> at /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/test/multiverse/lib/multiverse/suite.rb:14
"active_record_pg" for Envfile entry 2 failed!

Steps to Reproduce

Add the following to test/multiverse/suites/active_record_pg/Envfile and run the jruby_multiverse (rails) group on the CI.

if RUBY_VERSION >= '2.2.0' && RUBY_PLATFORM == 'java'

  gemfile <<-RB
    gem 'activerecord', '~> 5.0.0'
    gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0', :platform => :jruby
    #{boilerplate_gems}
  RB

  gemfile <<-RB
    gem 'activerecord', '~> 5.1.0'
    gem 'activerecord-jdbcpostgresql-adapter', '~> 51.0',  :platform => :jruby
    #{boilerplate_gems}
  RB

  gemfile <<-RB
    gem 'activerecord', '~> 5.2.0'
    gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0',  :platform => :jruby
    #{boilerplate_gems}
  RB
end

Additional information

This error is not raised when running the multiverse locally

@kaylareopelle
Copy link
Contributor Author

Issue reported to activerecord-jdbc-adapter repository: jruby/activerecord-jdbc-adapter#1101

@workato-integration
Copy link

@fallwith
Copy link
Contributor

fallwith commented Jun 5, 2023

Given the latest JRuby's RUBY_VERSION of v3, no need to go back to Rails 5 when 6 and 7 are supported.

@fallwith fallwith closed this as completed Jun 5, 2023
@fallwith fallwith added the integration Represents tracked integration test gaps label Jun 6, 2023
@kford-newrelic kford-newrelic moved this to Code Complete/Done in Ruby Engineering Board Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration Represents tracked integration test gaps technical debt
Projects
Archived in project
Development

No branches or pull requests

3 participants