New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 653072 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

CronetFixedModeOutputStreamTest#testGetResponseAfterWriteFailed is flaky

Project Member Reported by xunji...@chromium.org, Oct 5 2016

Issue description

CronetFixedModeOutputStreamTest#testGetResponseAfterWriteFailed is flaky when testing system's HttpURLConnection implementation.

https://build.chromium.org/p/chromium.android/builders/Android%20Cronet%20Builder%20%28dbg%29/builds/3223

C  334.957s Main  [FAIL] org.chromium.net.urlconnection.CronetFixedModeOutputStreamTest#testGetResponseAfterWriteFailed:
C  334.958s Main  java.lang.Throwable: CronetTestBase#runTest failed.
C  334.958s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:120)
C  334.958s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C  334.958s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C  334.958s Main  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
C  334.958s Main  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
C  334.958s Main  Caused by: junit.framework.AssertionFailedError
C  334.958s Main  	at org.chromium.net.urlconnection.CronetFixedModeOutputStreamTest.testGetResponseAfterWriteFailed(CronetFixedModeOutputStreamTest.java:112)
C  334.958s Main  	at java.lang.reflect.Method.invokeNative(Native Method)
C  334.958s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:106)


The assertion failed on fail().

        try {
            OutputStream out = connection.getOutputStream();
            out.write(1);
            fail();  <--- assertion failed.
        } catch (IOException e) {
            if (!testingSystemHttpURLConnection()) {
                UrlRequestException requestException = (UrlRequestException) e;
                assertEquals(UrlRequestException.ERROR_CONNECTION_REFUSED,
                        requestException.getErrorCode());
            }
        }
 
Owner: xunji...@chromium.org
Status: Assigned (was: Available)
Actually the flakiness is from a different unit test: CronetChunkedOutputStreamTest#testGetResponseAfterWriteFailed.

Both these tests fail when running system's implementation.
Project Member

Comment 3 by bugdroid1@chromium.org, Oct 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3651f8788be0a253a4e49e562a5b8e2c504b1fd2

commit 3651f8788be0a253a4e49e562a5b8e2c504b1fd2
Author: xunjieli <xunjieli@chromium.org>
Date: Mon Oct 17 23:10:51 2016

Fix testGetResponseAfterWriteFailed flake

When running the system HttpURLConnection implementation,
write() doesn't always fail. This CL forces system
implementation to flush the write by calling
OutputStream#flush(), so the system implementation must
know that the connection has died.

This is an attempt to fix the test flakiness observed when running system implementation.

BUG= 653072 

Review-Url: https://codereview.chromium.org/2401413002
Cr-Commit-Position: refs/heads/master@{#425805}

[modify] https://crrev.com/3651f8788be0a253a4e49e562a5b8e2c504b1fd2/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
[modify] https://crrev.com/3651f8788be0a253a4e49e562a5b8e2c504b1fd2/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java

Status: Fixed (was: Assigned)
Fixed hopefully..

Comment 5 by mge...@chromium.org, Oct 19 2016

Status: Assigned (was: Fixed)
Nope, saw another one this morning. :(
Owner: ----
Status: Available (was: Assigned)
Can you paste the link?
Thanks for the link!

C  153.347s Main  [FAIL] org.chromium.net.urlconnection.CronetFixedModeOutputStreamTest#testGetResponseAfterWriteFailed:
C  153.347s Main  java.lang.Throwable: CronetTestBase#runTest failed.
C  153.347s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:127)
C  153.348s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C  153.348s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C  153.348s Main  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
C  153.348s Main  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
C  153.348s Main  Caused by: junit.framework.AssertionFailedError
C  153.348s Main  	at org.chromium.net.urlconnection.CronetFixedModeOutputStreamTest.testGetResponseAfterWriteFailed(CronetFixedModeOutputStreamTest.java:114)
C  153.348s Main  	at java.lang.reflect.Method.invokeNative(Native Method)
C  153.348s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:117)
C  153.348s Main  	... 9 more
C  153.348s Main  ********************************************************************************
C  153.348s Main  Summary
C  153.348s Main  ********************************************************************************
C  153.349s Main  [==========] 296 tests ran.
C  153.350s Main  [  PASSED  ] 295 tests.
C  153.350s Main  [  FAILED  ] 1 test, listed below:
C  153.350s Main  [  FAILED  ] org.chromium.net.urlconnection.CronetFixedModeOutputStreamTest#testGetResponseAfterWriteFailed
C  153.350s Main  
C  153.350s Main  1 FAILED TEST

System's implementation is misbehaving :( I've run out of ideas. 
Status: Untriaged (was: Available)
Another flaky run because of system's implementation:

https://build.chromium.org/p/chromium.android/builders/Android%20Cronet%20Marshmallow%2064bit%20Builder/builds/4570/steps/cronet_test_instrumentation_apk/logs/stdio


E  508.813s Main  Default retries are being phased out.  crbug.com/619055 
I  508.814s Main  FINISHED TRY #1/1
I  508.814s Main  All tests completed.
C  508.814s Main  ********************************************************************************
C  508.814s Main  Detailed Logs
C  508.814s Main  ********************************************************************************
C  508.815s Main  [FAIL] org.chromium.net.urlconnection.CronetChunkedOutputStreamTest#testGetResponseAfterWriteFailed:
C  508.815s Main  java.lang.Throwable: CronetTestBase#runTest failed.
C  508.815s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:127)
C  508.815s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C  508.815s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C  508.815s Main  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
C  508.815s Main  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
C  508.815s Main  Caused by: junit.framework.AssertionFailedError
C  508.815s Main  	at org.chromium.net.urlconnection.CronetChunkedOutputStreamTest.testGetResponseAfterWriteFailed(CronetChunkedOutputStreamTest.java:133)
C  508.815s Main  	at org.chromium.net.CronetTestBase.runTest(CronetTestBase.java:117)
C  508.815s Main  	... 9 more
C  508.815s Main  ********************************************************************************
C  508.815s Main  Summary
C  508.815s Main  ********************************************************************************
C  508.816s Main  [==========] 297 tests ran.
C  508.816s Main  [  PASSED  ] 296 tests.
C  508.816s Main  [  FAILED  ] 1 test, listed below:
C  508.816s Main  [  FAILED  ] org.chromium.net.urlconnection.CronetChunkedOutputStreamTest#testGetResponseAfterWriteFailed
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d2126e1d2d73c397a9de611ed8b4a630ca76754

commit 7d2126e1d2d73c397a9de611ed8b4a630ca76754
Author: xunjieli <xunjieli@chromium.org>
Date: Thu Dec 15 20:44:00 2016

[Cronet] Adjust testGetResponseAfterWriteFailed for system HUC implementation

System HUC implementation is flaky. This CL adjusts
testGetResponseAfterWriteFailed to run Cronet's HUC
implementation for a portion of the test.

R=pauljensen@chromium.org

BUG= 653072 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester

Review-Url: https://codereview.chromium.org/2582523002
Cr-Commit-Position: refs/heads/master@{#438916}

[modify] https://crrev.com/7d2126e1d2d73c397a9de611ed8b4a630ca76754/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetChunkedOutputStreamTest.java
[modify] https://crrev.com/7d2126e1d2d73c397a9de611ed8b4a630ca76754/components/cronet/android/test/javatests/src/org/chromium/net/urlconnection/CronetFixedModeOutputStreamTest.java

Owner: xunji...@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment