Closed cyrusstoller closed 11 years ago
Mmm maybe that the PID killed is the Foreman process and that doesn't kill the Spork process launched by it. Make sense?
I tried running spork in debug mode and it looked like the right spork PIDs were getting killed. How would you check the foreman PIDs?
Mmm so maybe Foreman relaunch it automatically, I don't use Foreman often sorry.
To get Foreman pid try: ps aux | awk '/foreman/&&!/awk/{print $2;}
Still an issue?
Thanks for working on this. The issue has changed a little.
But if I keep :foreman => true
I still get the following error message
Rack::File headers parameter replaces cache_control after Rack 1.5.
Address already in use - bind(2) (Errno::EADDRINUSE)
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `initialize'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `open'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:861:in `open_server'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:759:in `block in open_server'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:757:in `each'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:757:in `open_server'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1342:in `initialize'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1624:in `new'
/Users/cyrusstoller/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/drb/drb.rb:1624:in `start_service'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/gems/spork-0.9.2/lib/spork/server.rb:29:in `listen'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/gems/spork-0.9.2/lib/spork/server.rb:20:in `run'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/gems/spork-0.9.2/lib/spork/runner.rb:75:in `run'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/bin/spork:23:in `load'
/Users/cyrusstoller/.rvm/gems/ruby-1.9.3-p125@hazelnut/bin/spork:23:in `<main>'
Running tests with args ["--color"]...
Done.
Then the tests proceed anyway, but the environment hasn't been reloaded. I just did a simple test of changing the routes file to include a unreasonable route and my tests still passed.
Ok, too bad. I'm sorry but I don't use Spork anymore so I'm not sure how to fix that. Maybe we should remove the foreman feature.
What are you using instead of Spork?
I mostly test my code in isolation without loading Rails. More info at: http://silkandspinach.net/2011/08/08/why-i-dont-use-spork/
Interesting. I'm always interested in learning how other people test. Most of my service classes I test in isolation. I guess the main reason I load the rails env is for integration tests and testing controllers.
I personally don't test controllers that much, I mostly load rails env for persistence (model) test & integration. So having to wait some seconds for them isn't worth the setup/maintenance of Spork or Zeus.
In my
Guardfile
I had the followingThis was working fine, but when I tried to add a new route to my
config/routes.rb
I got the following error when Spork was reloadingI was able to get normal behavior again when I removed the
:foreman => true
I ran Guard in debug mode and saw that it was in fact killing the old PID.
RIght now I'm not writing any tests that depend on vars in
.env
but I might later.Thanks for this awesome gem.