guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

Guard-spork timer not resetting between runs #39

Closed murdoch closed 12 years ago

murdoch commented 12 years ago

Having some trouble with guard and spork and can't isolate the issue to a specific gem so I apologise if this is in the wrong place.


I'm using guard to watch my specs and to run spork for me so I've got the following in my Gemfile:

group :development, :test do
  gem 'guard-rspec' 
  gem 'guard-spork'
  gem 'spork', '~> 0.9.0.rc'
end

Everything is running smoothly except for one tiny thing:

The timer that counts how long my specs are taking to run (after I start guard) is not being reset between runs and instead outputs the total time since spork was started.

So basically what's happening is:

  1. I start guard and the console tells me that the specs took about 25 seconds to run.
  2. I then wait a whole minute, modify a controller spec, and note that this time round they only take about 6 seconds to run. But my console tells me that they took closer to 90 seconds.
  3. If I wait 1 hour and repeat step 2, the tests run in 5 seconds again, but the console tells me that they took 1 hour to run.
  4. If I modify one of the files that guard-spork is watching then spork gets reloaded and the timer gets reset and we start again.

Clearly, one of the gems involved is not behaving.

using latest released versions of all gems:

My spec_helper is just the standard one that rspec-rails generates for you and I've put everything inside the spork prefork block. The only modifications I've made to my Guardfile is that I've added :cli=>"---drb" to the rspec declaration

murdoch commented 12 years ago

Closing this because the problem happens when just using spork on it's own without guard. So I will ask the spork team .

rymai commented 12 years ago

That's in fact an RSpec issue reported both in guard and in rspec-core (don't have the links in mind sorry).

Thanks!

rymai commented 12 years ago

Just FYI, it was reported in guard-rspec here and in rspec-core here.

murdoch commented 12 years ago

Thanks rymai, the fix you suggested works perfectly and I've updated the stackoverflow question I asked about it too. Thanks again