infinite loop using --drb in spec.opts and rspec 1.3.0 #33

glenjamin opened this Issue Mar 25, 2010 · 5 comments


None yet
4 participants

I'm currently playing with getting spork working for a merb app we're working on - I'm pretty sure i've managed to split up the bootloading process of merb into prefork and each_run.

However, i'm running into a problem that appears to be mostly unrelated to merb. Here's the flow as I follow it:

spork rspec (starts spork server)

  • this runs ruby spec file_list -O spec/spec.opts
  • as spec.opts contains --drb, the parse_options stuff in rspec bails out at parse_drb and runs the DrbCommandLine runner
  • The DRB Runner sends the run message to spork, which runs the test_framework run_tests method
  • run_tests for RSpec fires up the the normal CommandLine runner but the commandline runner saves the current options
  • the current options are loaded from Spec::Runner.options, which is a lazy loading attribute which fetches the options from ARGV
  • however if ARGV contains no switches, then the options are loaded in from spec.opts (which contains --drb)
  • hence the option parser sees the --drb flag and starts this whole process again!

I'm not quite sure why no-one else is running into this issue (or at least, no-one seems to be running into it and posting anything about it on the internet)

I'm probably going to work around the problem using a slightly messy hack for the moment, but I'm unsure what would be a good clean way to fix this.


timcharper commented Mar 25, 2010

this is really weird: I've never run into this, that, now that you mention it, it's weird that I haven't!

I would say that this problem lies on the RSpec side: RSpec shouldn't be sending the --drb parameter over. I will have to take a look and see why it doesn't happen in rails.

Can you run the cucumber features and see if you can reproduce it with those? (Spork is quite heavily tested with integration tests, I run them against versions of rails 2.1.0 through 2.3.5)

woahdae commented Oct 28, 2011

On installing rspec 1.3.2 in a rails 2.3 app, I ran into this also. I'll figure out some hack around, but definitely in a console, Spec::Runner.options starts the infinite loop.

Any solutions?

woahdae commented Mar 1, 2012

I ended up upgrading to rails 3...

I wound up getting rid of spec.opts and adding the options to the :opts parameter in Guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment