minitest / minitest

minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.

Home Page:https://docs.seattlerb.org/minitest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minitest with JRuby

DrJuriko opened this issue · comments

I am very new to Ruby, it is my first project. I have created tests with Ruby (Ruby31-x64 Windows) and everything were fine. But when I switched to JRuby I receive this error with all tests:

[26512, #<Thread:0x517566b@main run>, #<RuntimeError: CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true>, ["D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:167:in `require'", "D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:408:in `validate_lazy_metadata'", "D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:89:in `validate_required!'", "D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:44:in `validate'", "D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification.rb:2635:in `validate'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/rubygems_integration.rb:68:in `block in validate'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/ui/shell.rb:159:in `with_level'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/ui/shell.rb:111:in `silence'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/rubygems_integration.rb:68:in `validate'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/source/path.rb:168:in `validate_spec'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/source/path.rb:182:in `block in load_spec_files'", "org/jruby/RubyArray.java:1988:in `each'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/source/path.rb:176:in `load_spec_files'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/source/path.rb:107:in `local_specs'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/source/path.rb:115:in `specs'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:641:in `specs_for_source_changed?'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:626:in `specs_changed?'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:678:in `block in converge_paths'", "org/jruby/RubyArray.java:4961:in `any?'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:677:in `converge_paths'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:136:in `initialize'", "org/jruby/RubyClass.java:931:in `new'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/dsl.rb:218:in `to_definition'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/dsl.rb:13:in `evaluate'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/definition.rb:37:in `build'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler.rb:216:in `definition'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler.rb:164:in `setup'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/setup.rb:10:in `block in <main>'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/ui/shell.rb:159:in `with_level'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/ui/shell.rb:111:in `silence'", "D:/jruby-9.4.1.0/lib/ruby/gems/shared/gems/bundler-2.4.7/lib/bundler/setup.rb:10:in `<main>'", "org/jruby/RubyKernel.java:1057:in `require'", "D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85:in `require'"]]
  require at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:167
... 2 levels...
RuntimeError: CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true
                    require at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:167
     validate_lazy_metadata at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:408
         validate_required! at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:89
                   validate at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification_policy.rb:44
                   validate at D:/jruby-9.4.1.0/lib/ruby/stdlib/rubygems/specification.rb:2635

Reformatted. Please use ``` to fence in code blocks

I don't see minitest anywhere near this output. What led you to file the bug here?

Yes, thank you... as far I undestand, Minitest should work with JRuby too and I have development environment or similar issue.

again, I don't see minitest in here.

Sorry that disturb you, I think that it is not a Minitest problem, but I don't know where to dig. Another PC, just JRuby installed and tests were run via Rake.

cmd.exe /c "rake test --trace"
** Invoke test (first_time)
** Execute test
C:/Ruby/jruby-9.4.1.0/bin/jruby.exe -Ilib;test;.;test;lib -e 'require "minitest/
autorun"; require "test/utils/util_users_test.rb"; require "test/utils/util_base
_test.rb"; require "test/utils/util_browser_test.rb"; require "test/browsers/uti
l_browser_support_chrome_test.rb"; require "test/lib_browserbeat_test.rb"; requi
re "test/utils/util_database_test.rb"' --
NameError: undefined local variable or method `minitest' for main:Object
  <main> at -e:1
... 2 levels...
rake aborted!
Command failed with status (1): [C:/Ruby/jruby-9.4.1.0/bin/jruby.exe -Ilib;...]
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/file_utils.
rb:67:in `block in create_shell_runner'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/file_utils.
rb:57:in `sh'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/file_utils.
rb:104:in `ruby'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/minitest-5.17.0/lib/minitest/tes
t_task.rb:164:in `block in define'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281
:in `block in execute'
org/jruby/RubyArray.java:1988:in `each'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:281
:in `execute'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:219
:in `block in invoke_with_call_chain'
org/jruby/ext/monitor/Monitor.java:82:in `synchronize'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:199
:in `invoke_with_call_chain'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/task.rb:188
:in `invoke'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:160:in `invoke_task'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:116:in `block in top_level'
org/jruby/RubyArray.java:1988:in `each'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:116:in `block in top_level'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:125:in `run_with_threads'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:110:in `top_level'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:83:in `block in run'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:186:in `standard_exception_handling'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/lib/rake/application
.rb:80:in `run'
C:/Ruby/jruby-9.4.1.0/lib/ruby/gems/shared/gems/rake-13.0.6/exe/rake:27:in `<mai
n>'
org/jruby/RubyKernel.java:1091:in `load'
C:/Ruby/jruby-9.4.1.0/bin/rake:23:in `<main>'
Tasks: TOP => test

Process finished with exit code 1.

Without seeing your code, I'm afraid nobody can help.

no response. closing.