DispatchClientServerTest fails on Windows
-----------------------------------------

                 Key: CXF-2865
                 URL: https://issues.apache.org/jira/browse/CXF-2865
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.3
         Environment: Windows Vista 64 bit
            Reporter: Yaytay
            Priority: Minor


The test DispatchClientServerTest fails with: java.lang.AssertionError: 
java.net.SocketTimeoutException.
Stack trace for the exception: 
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
        at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
        at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
        at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
        at 
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:904)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1869)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1821)
        at 
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
        at 
org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
        at 
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1889)

The causes for the issue are twofold:
1. On Windows a failed connection to localhost takes 'some time' to fail, on 
Linux and MacOS it fails instantly.
2. The exception for a failed connection is java.net.ConnectException, but the 
exception for a timed out connection is java.net.SocketTimeoutException.
So on Windows the SocketTimeoutException is seen and on Linux and MacOS the 
ConnectException is seen - not even Java can paper over OS level differences 
here.
The test currently only considers the ConnectException to be valid, and thus 
fails on Windows.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to