rspec always return 1 when executed through Spork on Windows #210

Open
os97673 opened this Issue Sep 22, 2012 · 7 comments

Projects

None yet

4 participants

os97673 commented Sep 22, 2012

This is Windows-specific issue.
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.
Initially I've filed this as bug againsr rspec (rspec/rspec-core#641), but after investigation I've found that the cause of the problem is in Spork::RunStrategy::Magazine which is used for JRuby and on Windows. And the actual result is lost somewhere between Magazine and MagazineSlave (Magazine.run receives IO object instead of integer from slave). All this reproducible with ruby 1.8.7p358, when I tried to use ruby 1.9.3p194 Magazine.run() just hangs on Rinda::RingFinger.primary :(

Here are files you need to reproduce the problem:

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'm having the same problem using MRI with Spork. It's causing my Rake task to bail out after the tests instead of completing. I have a task that runs rspec and then Jasmine tests and the Jasmine tests never get run.

os97673 commented Nov 23, 2012

The hang might be fixed by #214 pull request

Can @jdmarshall or @os97673 verify? Thanks much.

Whoops, for some reason I thought this issue was on rspec.

So did you need me to test something?

This patch seems to fix the problem.

👍

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