Skip to content

Fix order dependent spec on JRuby

gitlab-qa-bot requested to merge fix-order-dependent-failure-on-jruby into master

Created by: yujinakayama

The bisect feature internally uses DRb server. It properly stops the server after the processing, but DRb.current_server won't be nil even after invoking DRbServer#stop_service. Thus Runner.running_in_drb? will unintentionally continue returning true once Bisect::Server.run is invoked in the process. In that case we need to check DRbServer.alive?.

$ ruby --version
jruby 1.7.22 (1.9.3p551) 2015-08-20 c28f492 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 +jit [darwin-x86_64]
$ bundle exec rspec './spec/integration/bisect_spec.rb[1:2:1]' './spec/rspec/core/configuration_spec.rb[1:13:13:3]' --seed 36379 --format doc

Randomized with seed 36379

Bisect
  when the spec ordering is inconsistent
    stops bisecting and surfaces the problem to the user

RSpec::Core::Configuration
  #files_to_run
    with default default_path
      does not load files in the default path when run by ruby (FAILED - 1)

Failures:

  1) RSpec::Core::Configuration#files_to_run with default default_path does not load files in the default path when run by ruby
     Failure/Error: expect(config.files_to_run).to be_empty
       expected `["/Users/nkymyj/Projects/rspec-dev/repos/rspec-core/spec/integration/bisect_spec.rb", "/Users/nkymyj/...ec/core/world_spec.rb", "/Users/nkymyj/Projects/rspec-dev/repos/rspec-core/spec/rspec/core_spec.rb"].empty?` to return true, got false
     # ./spec/rspec/core/configuration_spec.rb:553:in `Core'
     # ./spec/support/sandboxing.rb:14:in `(root)'
     # ./spec/support/sandboxing.rb:7:in `(root)'

Merge request reports