Issue Details (XML | Word | Printable)

Key: JRUBY-3283
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Rich Apodaca
Votes: 5
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
JRuby

closed stream (IOError) from rspec spec_server script

Created: 05/Jan/09 02:25 PM   Updated: 28/Mar/09 05:34 PM
Return to search
Component/s: Application Error
Affects Version/s: JRuby 1.1.6
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Ubuntu Linux


 Description  « Hide

Create an empty rails 2.2.2 project and a dummy controller test.

Next, start the rspec server with:

jruby script/spec_server

This appears to work fine:

Loading Rails environment
Ready

Open a new terminal and then:

jruby script/spec -X spec/controllers/test_controller_spec.rb

gives "closed stream (IOError)"

For full details, see:

http://www.nabble.com/spec_server-in-Rails-app--td17627372.html



Thomas E Enebo made changes - 05/Jan/09 06:58 PM
Field Original Value New Value
Assignee Thomas E Enebo [ enebo ]
Component/s Application Error [ 12271 ]
Miika Leppänen added a comment - 19/Jan/09 02:18 AM

I'm having the same issue:
$ jruby -S spec -X -o spec/spec.opts spec/controllers/companies_controller_spec.rb
(druby://127.0.0.1:8989) script/spec_server:14:in `run': closed stream (IOError)
from (druby://127.0.0.1:8989) /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1548:in `perform_without_block'
from (druby://127.0.0.1:8989) /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1508:in `perform'
from (druby://127.0.0.1:8989) /usr/local/jruby/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'
from (druby://127.0.0.1:8989) :1:in `accept'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/drb_command_line.rb:13:in `run'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/option_parser.rb:188:in `parse_drb'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/option_parser.rb:128:in `order!'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner.rb:59:in `options'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/bin/spec:4:in `run'
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/bin/spec:4
from /usr/local/jruby-trunk/lib/ruby/gems/1.8/gems/rspec-1.1.12/bin/spec:19:in `load'
from /usr/local/jruby/bin/spec:19


Mike Grafton added a comment - 22/Mar/09 06:44 PM

I am also seeing this problem. It is especially irksome given how long it takes JRuby to start up Rails - doing TDD is very painful when it takes 10 seconds just to get your spec going!

In this world, the rspec spec_server is a very helpful way to speed up your TDD cycles. Getting this working would be a big win for JRuby!


Ulrik Schønnemann added a comment - 23/Mar/09 03:46 AM

This is an important issue for my team as well. We can not upgrade from Rails 2.1.0 due to the speed of running specs in higher versions...


Matthew Churcher added a comment - 28/Mar/09 05:34 PM

I'd suggest you have two issues here:

1.) RSpec in JRuby fails to catch Java Exceptions, hence the exception prints to the console rather then the RSpec output.
To work around this catch all Java exceptions thrown by your code and raise a ruby exception instead
e.g.

begin
myJavaClass.thowsException()
rescue MyJavaException => e
raise "My Custom Java Exception"
end

2.) JRuby is throwing an unhanded Java NullPointerException, which seems to trigger this "closed stream IOError" when attempting to wrap it to a ruby object.