Harmony
  1. Harmony
  2. HARMONY-1879

[drlvm][unit] org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Environment:
      SLES 9.0/ia32
    • Estimated Complexity:
      Moderate

      Description

      The test fails from time to time.

      $ while true; do ../drlvm/build/lnx_ia32_gcc_debug/deploy/jre/bin/java -cp modules/luni/bin/test:depends/jars/junit_3.8.2/junit.jar junit.textui.TestRunner org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest; done 2>&1 | tee http.log

      Here is output:

      ------------------------------------------
      There was 1 error:
      1) testUsingProxy(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:42670 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:630)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:581)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxy(HttpURLConnectionTest.java:203)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)
      ------------------------------------------

      There were 2 errors:
      1) testUsingProxy(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:42703 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:630)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:581)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxy(HttpURLConnectionTest.java:203)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)
      2) testUsingProxySelector(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:42705 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:626)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxySelector(HttpURLConnectionTest.java:245)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)

      ------------------------------------------
      There were 2 errors:
      1) testGetOutputStream(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:43262 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:626)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:926)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testGetOutputStream(HttpURLConnectionTest.java:172)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)
      2) testUsingProxySelector(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:43267 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:626)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxySelector(HttpURLConnectionTest.java:245)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)
      ------------------------------------------

      There were 2 errors:
      1) testGetOutputStream(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:43423 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:626)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:926)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testGetOutputStream(HttpURLConnectionTest.java:172)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)
      2) testUsingProxy(org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:43426 - Connection refused
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224)
      at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496)
      at java.net.Socket.connect(Socket.java:978)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:630)
      at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:581)
      at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxy(HttpURLConnectionTest.java:203)
      at java.lang.reflect.VMReflection.invokeMethod(Native Method)

        Issue Links

          Activity

          Alexei Fedotov created issue -
          Hide
          Alexei Fedotov added a comment -

          The summary should be prefixed with [drlvm][unit]

          See http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM

          Show
          Alexei Fedotov added a comment - The summary should be prefixed with [drlvm] [unit] See http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM
          Hide
          Alexei Fedotov added a comment -
          Show
          Alexei Fedotov added a comment - The bug still can be reproduced, see http://harmonytest.org/testapp.do?method=showresult&id=620099
          Hide
          Alexei Fedotov added a comment -

          All works perfectly on Ubuntu. Again, Vladimir Ivanov regularly uploads how the following test cases fail to http://www.harmonytest.org/testapp.do?method=findtest&name=org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest

          org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testUsingProxy
          org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testGetOutputStream
          org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testUsingProxySelector

          Show
          Alexei Fedotov added a comment - All works perfectly on Ubuntu. Again, Vladimir Ivanov regularly uploads how the following test cases fail to http://www.harmonytest.org/testapp.do?method=findtest&name=org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testUsingProxy org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testGetOutputStream org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest@testUsingProxySelector
          Alexey Varlamov made changes -
          Field Original Value New Value
          Link This issue is duplicated by HARMONY-2082 [ HARMONY-2082 ]
          Alexei Fedotov made changes -
          Summary org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails [classlib][luni] org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails
          Hide
          Alexei Fedotov added a comment -

          I'm not sure, but at least the issue should be rechecked after the fix of HARMONY-2075

          Show
          Alexei Fedotov added a comment - I'm not sure, but at least the issue should be rechecked after the fix of HARMONY-2075
          Alexei Fedotov made changes -
          Link This issue is related to HARMONY-2075 [ HARMONY-2075 ]
          Alexey Petrenko made changes -
          Summary [classlib][luni] org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails [drlvm][unit] org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails
          Hide
          Alexei Fedotov added a comment -

          I have successfully reproduced the problem today on SuSE 9:

          $ ../../drlvm/trunk/build/lnx_ia32_gcc_debug/deploy/jre/bin/java -cp modules/lu
          ni/bin/test:depends/jars/junit_3.8.2/junit.jar junit.textui.TestRunner org.apac
          he.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest
          ..E.E.
          Time: 20.178
          There were 2 errors:
          1) testUsingProxy(org.apache.harmony.tests.internal.net.www.protocol.http.HttpU
          LConnectionTest)java.net.ConnectException: localhost/127.0.0.1:47601 - Connecti
          n refused
          at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.
          ava:224)
          at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.
          ava:496)
          at java.net.Socket.connect(Socket.java:978)
          at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec
          ion.getHTTPConnection(HttpURLConnection.java:630)
          at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec
          ion.connect(HttpURLConnection.java:581)
          at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConne
          tionTest.testUsingProxy(HttpURLConnectionTest.java:201)
          at java.lang.reflect.VMReflection.invokeMethod(Native Method)
          2) testUsingProxySelector(org.apache.harmony.tests.internal.net.www.protocol.ht
          p.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:47603 -
          onnection refused
          at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.
          ava:224)
          at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.
          ava:496)
          at java.net.Socket.connect(Socket.java:978)
          at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec
          ion.getHTTPConnection(HttpURLConnection.java:627)
          at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec
          ion.connect(HttpURLConnection.java:608)
          at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConne
          tionTest.testUsingProxySelector(HttpURLConnectionTest.java:246)
          at java.lang.reflect.VMReflection.invokeMethod(Native Method)

          FAILURES!!!
          Tests run: 4, Failures: 0, Errors: 2

          Show
          Alexei Fedotov added a comment - I have successfully reproduced the problem today on SuSE 9: $ ../../drlvm/trunk/build/lnx_ia32_gcc_debug/deploy/jre/bin/java -cp modules/lu ni/bin/test:depends/jars/junit_3.8.2/junit.jar junit.textui.TestRunner org.apac he.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest ..E.E. Time: 20.178 There were 2 errors: 1) testUsingProxy(org.apache.harmony.tests.internal.net.www.protocol.http.HttpU LConnectionTest)java.net.ConnectException: localhost/127.0.0.1:47601 - Connecti n refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl. ava:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl. ava:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec ion.getHTTPConnection(HttpURLConnection.java:630) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec ion.connect(HttpURLConnection.java:581) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConne tionTest.testUsingProxy(HttpURLConnectionTest.java:201) at java.lang.reflect.VMReflection.invokeMethod(Native Method) 2) testUsingProxySelector(org.apache.harmony.tests.internal.net.www.protocol.ht p.HttpURLConnectionTest)java.net.ConnectException: localhost/127.0.0.1:47603 - onnection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl. ava:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl. ava:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec ion.getHTTPConnection(HttpURLConnection.java:627) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnec ion.connect(HttpURLConnection.java:608) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConne tionTest.testUsingProxySelector(HttpURLConnectionTest.java:246) at java.lang.reflect.VMReflection.invokeMethod(Native Method) FAILURES!!! Tests run: 4, Failures: 0, Errors: 2
          Hide
          tatyana doubtsova added a comment -

          I also observe the problem on Win XP 50 times out of 50 while running luni module in Other VM mode:

          $ ant -Dtest.jre.home=c:/users/tdoubtso/harmony/drlvm/trunk/build/win_ia32_msvc_debug/deploy/jre -Dbuild.module=luni -Dhy.test.forkmode=perTest test 2>&1 | tee log_luni.txt

          testUsingProxy Error localhost/127.0.0.1:3718 - Connection refused

          java.net.ConnectException: localhost/127.0.0.1:3718 - Connection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:630) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:581) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxy(HttpURLConnectionTest.java:201) at java.lang.reflect.VMReflection.invokeMethod(Native Method)

          testUsingProxySelector Error localhost/127.0.0.1:3720 - Connection refused

          java.net.ConnectException: localhost/127.0.0.1:3720 - Connection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:627) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxySelector(HttpURLConnectionTest.java:246) at java.lang.reflect.VMReflection.invokeMethod(Native Method)

          Show
          tatyana doubtsova added a comment - I also observe the problem on Win XP 50 times out of 50 while running luni module in Other VM mode: $ ant -Dtest.jre.home=c:/users/tdoubtso/harmony/drlvm/trunk/build/win_ia32_msvc_debug/deploy/jre -Dbuild.module=luni -Dhy.test.forkmode=perTest test 2>&1 | tee log_luni.txt testUsingProxy Error localhost/127.0.0.1:3718 - Connection refused java.net.ConnectException: localhost/127.0.0.1:3718 - Connection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:630) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:581) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxy(HttpURLConnectionTest.java:201) at java.lang.reflect.VMReflection.invokeMethod(Native Method) testUsingProxySelector Error localhost/127.0.0.1:3720 - Connection refused java.net.ConnectException: localhost/127.0.0.1:3720 - Connection refused at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:224) at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:496) at java.net.Socket.connect(Socket.java:978) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:627) at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:608) at org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest.testUsingProxySelector(HttpURLConnectionTest.java:246) at java.lang.reflect.VMReflection.invokeMethod(Native Method)
          Hide
          Denis Kishenko added a comment -

          Additional log information showed that HttpURLConnection tried to connect when proxy had already closed. I exclude waiting while server/proxy started.from testUsingProxy and testUsingProxySelector
          synchronized(bound)

          { bound.wait(5000); }

          I checked this fix on linux and winXP, test is ok.

          Show
          Denis Kishenko added a comment - Additional log information showed that HttpURLConnection tried to connect when proxy had already closed. I exclude waiting while server/proxy started.from testUsingProxy and testUsingProxySelector synchronized(bound) { bound.wait(5000); } I checked this fix on linux and winXP, test is ok.
          Denis Kishenko made changes -
          Hide
          Denis Kishenko added a comment -

          During discussion with Alexei we decided to stay synchronization as is and add special flag that allow fix problem.

          Show
          Denis Kishenko added a comment - During discussion with Alexei we decided to stay synchronization as is and add special flag that allow fix problem.
          Denis Kishenko made changes -
          Alexey Petrenko made changes -
          Assignee Alexey Petrenko [ cap ]
          Hide
          Alexey Petrenko added a comment -

          The patch has been applied.
          Denis, Alexei, please verify

          Show
          Alexey Petrenko added a comment - The patch has been applied. Denis, Alexei, please verify
          Alexey Petrenko made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Hide
          Alexei Fedotov added a comment -

          I have successfully reproduced the failure at testGetOutputStream. I will file a separate issue about the second failure.

          Show
          Alexei Fedotov added a comment - I have successfully reproduced the failure at testGetOutputStream. I will file a separate issue about the second failure.
          Alexei Fedotov made changes -
          Link This issue incorporates HARMONY-2353 [ HARMONY-2353 ]
          Hide
          Alexei Fedotov added a comment -

          The patch was applied correctly.

          Show
          Alexei Fedotov added a comment - The patch was applied correctly.
          Alexei Fedotov made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Alexey Petrenko
              Reporter:
              Alexei Fedotov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development