2

I am currently in the process of upgrading a fairly large Rails application from Rails 3 --> Rails 4 (or maybe 5).

I am currently at a point where I have a Rails v4.0.13 application, running on Ruby v2.1.5. The test suite is running on RSpec v3.5.2, and is green (woohoo!), but unfortunately with some intermittent failures.

I'd ideally like to track down the cause of these failures before upgrading further, using rspec --bisect.

However, when I run rspec --bisect (with or without other arguments), I get the following error:

Bisect started using options: ""
Running suite to find failures...

Bisect failed! Failed to get results from the spec run. Spec run output:

(druby://127.0.0.1:33858) /home/tom/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/drb/drb.rb:1588:in `perform_without_block': undefined method `run' for #<RSpec::Core::Bisect::Server:0x00000001e71430> (NoMethodError)
        from (druby://127.0.0.1:33858) /home/tom/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/drb/drb.rb:1548:in `perform'
        from (druby://127.0.0.1:33858) /home/tom/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/drb/drb.rb:1626:in `block (2 levels) in main_loop'
        from (druby://127.0.0.1:33858) /home/tom/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/drb/drb.rb:1622:in `loop'
        from (druby://127.0.0.1:33858) /home/tom/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/drb/drb.rb:1622:in `block in main_loop'
        from /home/tom/.rvm/gems/ruby-2.1.5@<project-name>/gems/rspec-core-3.5.2/lib/rspec/core/drb.rb:23:in `run'
        from /home/tom/.rvm/gems/ruby-2.1.5@<project-name>/gems/rspec-core-3.5.2/lib/rspec/core/invocations.rb:19:in `call'
        from /home/tom/.rvm/gems/ruby-2.1.5@<project-name>/gems/rspec-core-3.5.2/lib/rspec/core/runner.rb:69:in `run'
        from /home/tom/.rvm/gems/ruby-2.1.5@<project-name>/gems/rspec-core-3.5.2/lib/rspec/core/runner.rb:45:in `invoke'
        from /home/tom/.rvm/gems/ruby-2.1.5@<project-name>/gems/rspec-core-3.5.2/exe/rspec:4:in `<main>'

Has anyone got a clue what could be causing this, or how I may be able to track down the cause?

Some things I've tried so far, to no avail:

  • Downgrade rspec to a lower version (>= 3.3.0, since that's when --bisect was added).
  • Upgrade ruby to a higher version (namely 2.3.1). (This causes a few test failures which I'm yet to resolve, but still doesn't affect this --bisect issue).
  • Clean up the system with rvm gemset empty <project_name>; gem install bunder; bundle, to purge all the pre-upgrade library code that was lying around.

It's also worth noting that I have other Rails projects on this computer, for which running --bisect works just fine - so I don't think this can be a system library compatibility issue. I guess it must be something to do with the project configuration -- but what?! (I can't even see an application back-trace for clues??)

Edit: Without finding a resolution to this yet, I've continued upgrading the application. It is now running Rails v4.2.7 and Ruby v2.3.1, with all specs passing (but still with some ordering issue). The error message when running rspec --bisect remains unchanged.

Tom Lord
  • 27,404
  • 4
  • 50
  • 77
  • DRb seems like a distraction. What happens when you run rspec --bisect without --drb? – Dave Schweisguth Aug 03 '16 at 22:12
  • I didn't include the `--drb` option; this behaviour seems to be a consequence of just using `--bisect` (?). I have also tried using the option [`--no-drb`](https://github.com/rspec/rspec-core/blob/350c21b6f66a54267ff615ed16604e017122e6be/spec/rspec/core/configuration_options_spec.rb#L3160), but again get an identical console output. – Tom Lord Aug 04 '16 at 08:32
  • See also, [this pull request](https://github.com/rspec/rspec-core/pull/2223) - although I'm not sure how relevant it is, since I've tried using older versions of rspec too. – Tom Lord Aug 04 '16 at 08:38
  • Oops, you're correct — --bisect uses DRb. – Dave Schweisguth Aug 04 '16 at 14:30
  • This is a long shot, but do you happen to have a `.rspec` file? I was able to recreate a similar error on an empty rails project with adding spork it to. The spork documentation suggests adding `--drb` straight to `.rspec` file. When I removed that option, the --bisect started to work again. – Laura Paakkinen Aug 04 '16 at 17:59
  • @LauraPaakkinen Yes!! I'd forgotten that a `.rspec` file even exists - and I guess my predecessor must have indeed been using `spork` when this project was first built. I still have no idea why including that flag causes such a cryptic failure, but removing it was all I needed to do. If you'd like to submit this as an answer, I'll award the bounty :) – Tom Lord Aug 05 '16 at 08:16

2 Answers2

2

I've seen this error and fixed it with bypassing spring and spring-commands-rspec.

Do not use bin/rspec --bisect, try:

# Stop spring
bin/spring stop

# Ensure rspec isn't using spring
bundle exec rspec --bisect
Eliot Sykes
  • 9,616
  • 6
  • 50
  • 64
0

This is a long shot, but do you happen to have a .rspec file?

I was able to recreate a similar error on an empty rails project with adding spork it to. For some reason running rspec --bisect --drb provokes this issue.

The spork documentation suggests adding --drb straight to .rspec file. So make sure that it has been removed and when you run just rspec --bisect it should work.

Laura Paakkinen
  • 1,661
  • 14
  • 22