http spec tests fail when webrick starts on address 0.0.0.0
-----------------------------------------------------------

                 Key: JRUBY-3178
                 URL: http://jira.codehaus.org/browse/JRUBY-3178
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.5
         Environment: MacOS 10.5.5, Java 1.5.0_16, JRuby trunk svn rev: 8104
            Reporter: Stephen Bannasch


Running these spec tests on my system:

{code}
spec/mspec/bin/mspec ci -t jruby spec/ruby/1.8/library/net/http/http
{code}

generates 21 failures and 44 errors.

Modifying the fixture used by the spec like this:

{code}
diff --git a/1.8/library/net/http/http/fixtures/http_server.rb 
b/1.8/library/net/http/http/fixtures/http_server.rb
index 6173972..0647c69 100644
--- a/1.8/library/net/http/http/fixtures/http_server.rb
+++ b/1.8/library/net/http/http/fixtures/http_server.rb
@@ -51,7 +51,7 @@ module NetHTTPSpecs
   class << self
     def start_server
       server_config = {
-        :BindAddress => "0.0.0.0",
+        :BindAddress => "127.0.0.1",
         :Port => 3333,
         :Logger => WEBrick::Log.new(NullWriter.new),
         :AccessLog => [],
{code}

and then running the tests (while displaying more status data):

{code}
spec/mspec/bin/mspec ci -V -f s -t jruby spec/ruby/1.8/library/net/http/http
{code}

Works on my system.

However running them more quickly by removing the "-V -f s" params to mspec:

{code}
spec/mspec/bin/mspec ci -t jruby spec/ruby/1.8/library/net/http/http
{code}

Causes a hard crash: Exception in thread "Thread-601" 
java.nio.channels.CancelledKeyException

Stacktrace:
{code}
[jruby]$ spec/mspec/bin/mspec ci -t jruby spec/ruby/1.8/library/net/http/http
jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-22 rev 8104) [i386-java]
..................................................Exception in thread 
"Thread-601" java.nio.channels.CancelledKeyException
        at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
        at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
        at 
sun.nio.ch.KQueueSelectorImpl.updateSelectedKeys(KQueueSelectorImpl.java:105)
        at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:74)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:84)
        at org.jruby.RubyThread.select(RubyThread.java:819)
        at org.jruby.ext.socket.RubyTCPServer.accept(RubyTCPServer.java:145)
        at 
org.jruby.ext.socket.RubyTCPServer$i_method_0_0$RUBYINVOKER$accept.call(org/jruby/ext/socket/RubyTCPServer$i_method_0_0$RUBYINVOKER$accept.gen)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:73)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
        at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:120)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:222)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:144)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:107)
        at org.jruby.ast.BeginNode.interpret(BeginNode.java:80)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:155)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:113)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:114)
        at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
        at org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:107)
        at org.jruby.ast.IfNode.interpret(IfNode.java:103)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:153)
        at org.jruby.runtime.Block.yield(Block.java:120)
        at org.jruby.RubyArray.each(RubyArray.java:1555)
        at 
org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
        at 
org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:63)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.IfNode.interpret(IfNode.java:108)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.RescueNode.executeBody(RescueNode.java:222)
        at 
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:144)
        at org.jruby.ast.RescueNode.interpret(RescueNode.java:107)
        at org.jruby.ast.BeginNode.interpret(BeginNode.java:80)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.WhileNode.interpret(WhileNode.java:128)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:68)
        at 
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:202)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:190)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:64)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:70)
        at org.jruby.runtime.Block.call(Block.java:116)
        at org.jruby.RubyProc.call(RubyProc.java:205)
        at org.jruby.RubyProc.call(RubyProc.java:187)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:90)
        at java.lang.Thread.run(Thread.java:613)
^[[A^C
Process aborted!
{code}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to