When passing the RSpec invocation to Nailgun's JVM, any failing spec causes the process to hard crash with a SystemExit after completion.
To reproduce the bug, the Nailgun server is first started up as follows:
I created two trivial specs to illustrate the error:
describe "Simple Pass" do
it "should pass" do
true.should be_true
end
end
describe "Simple Fail" do
it "should fail" do
true.should be_false
end
end
Running the passing spec with the --ng option to pass to Nailgun works fine:
$ jruby --ng -S rspec simple_pass.rb
.
Finished in 0.004 seconds
1 example, 0 failures
$ echo $?
0
However, running the failing spec ends with an abnormal exit:
$ jruby --ng -S rspec simple_fail.rb
F
Failures:
1) Simple Fail should fail
Failure/Error: true.should be_false
expected: false value
got: true
# ./simple_fail.rb:3:in `(root)'
Finished in 0.005 seconds
1 example, 1 failure
Failed examples:
rspec ./simple_fail.rb:2 # Simple Fail should fail
org.jruby.exceptions.RaiseException: (SystemExit) exit
$ echo $?
131
Running without the *--ng* option (i.e., spawning a new JVM instead of using Nailgun's) caused the second example to exit cleanly, without the org.jruby.exceptions.RaiseException: (SystemExit) exit output and with a 0 exit code.
This behavior is consistent in more complex suites, and also occurs when running RSpec within Guard. (The desire to speed things up in Guard is in fact why I wanted to use Nailgun.) The inconsistent behavior when not passing to Nailgun is why my first guess was that this was some sort of RSpec bug; I've raised an issue on their Github project as well, but the maintainer said he would have to talk to the JRuby guys.
Thanks very much for your time.
|