Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspec always return 1 when executed through DRb server #641

Closed
os97673 opened this issue Jul 2, 2012 · 9 comments
Closed

rspec always return 1 when executed through DRb server #641

os97673 opened this issue Jul 2, 2012 · 9 comments

Comments

@os97673
Copy link

os97673 commented Jul 2, 2012

When I run rspec w/o Spork its's exit code behaves as expected (0 - passed, 1 - failed, and honor --failure-exit-code), but when I run tests using Spork it always exits with code 1.
It looks like the cause of the problem is in RSpec::Core::DRbCommandLine.run() which always returns result of spec_server.run(@options.drb_argv, err, out) which is IO and it looks like it is converted to 1 :(

@justinko
Copy link
Contributor

justinko commented Jul 3, 2012

I tested this extensively when trying to reproduce this issue: #640

If you can provide a failing test case, please report back here and I'll re-open. Thanks.

@justinko justinko closed this as completed Jul 3, 2012
@os97673
Copy link
Author

os97673 commented Jul 3, 2012

Gemfile

source "https://rubygems.org"

gem "rspec"
gem 'spork'

spec/test_spec.rb

require 'spec_helper'

describe "simple rspec test" do
  it "should just pass" do
  end
end

spec_helper.rb

require 'rubygems'
require 'spork'

Spork.prefork do
end

Spork.each_run do
end

require 'rspec'

I use ruby 1.8.7p358 on Windows (it is important, since on linux rspec does return 0)

rspec --drb spec
.

Finished in 0.008 seconds
1 example, 0 failures
  <-- Slave(1) run done!

echo %errorlevel%
1

Let me know if you need more information.

@justinko justinko reopened this Jul 5, 2012
@alindeman
Copy link
Contributor

@os97673, are you able to take a stab at fixing this? I have no Windows development environment that I can use; like you said, I can't reproduce it in Linux.

@os97673
Copy link
Author

os97673 commented Aug 22, 2012

@alindeman,

well, I think I can try :)

@alindeman
Copy link
Contributor

Thanks :D

@alindeman
Copy link
Contributor

Any news, @os97673?

@os97673
Copy link
Author

os97673 commented Sep 22, 2012

@alindeman,

sorry for delay, all "back to school" activities eat almost all my free time recently.
Finally I've got some time to investigate the problem.
It looks like the cause of the problem is in Spork. On Windows (and for JRuby) it uses Spork::RunStrategy::Magazine strategy while on Linux Spork::RunStrategy::Forking is used. And the actual result is lost somewhere between Magazine and MagazineSlave. Also, during investigation I've noticed that this strategy doesn't work with ruby 1.9.3.
Thus I'd say there is nothing rspec can fix itself, but Spork should be fixed instead (feel free to close the ticket).
I'm going to file ticket about the problem against Spork and will add link to it here.

@os97673
Copy link
Author

os97673 commented Sep 22, 2012

I've filed sporkrb/spork#210 about this problem.

@alindeman
Copy link
Contributor

Thanks so much @os97673. I'll close this issue and follow the sporkrb one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants