rspec always return 1 when executed through DRb server #641

os97673 opened this Issue Jul 2, 2012 · 9 comments


None yet

3 participants


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 which always returns result of, err, out) which is IO and it looks like it is converted to 1 :(


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 Jul 3, 2012


source ""

gem "rspec"
gem 'spork'


require 'spec_helper'

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


require 'rubygems'
require 'spork'

Spork.prefork do

Spork.each_run do

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%

Let me know if you need more information.

@justinko justinko reopened this Jul 5, 2012

@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.



well, I think I can try :)


Thanks :D


Any news, @os97673?



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.


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


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

@alindeman alindeman closed this Sep 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment