New issue
Advanced search Search tips

Issue 639138 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Recent flakes in PersonalDataManagerTest

Project Member Reported by donnd@chromium.org, Aug 18 2016

Issue description

Looks like there is some increased flakyness to PersonalDataManagerTest in the last day.  We're there any changes you can think of that might have caused this?

https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=org.chromium.chrome.browser.autofill.PersonalDataManagerTest


Here's an example run that failed a couple: 
https://build.chromium.org/p/chromium.android/builders/KitKat%20Tablet%20Tester/builds/5174

Output from that log:

C 2360.795s Main  [FAIL] org.chromium.chrome.browser.autofill.PersonalDataManagerTest#testAddAndEditCreditCards:
C 2360.795s Main  junit.framework.AssertionFailedError: expected:<1> but was:<0>
C 2360.795s Main  	at org.chromium.chrome.browser.autofill.PersonalDataManagerTest.testAddAndEditCreditCards(PersonalDataManagerTest.java:128)
C 2360.795s Main  	at java.lang.reflect.Method.invokeNative(Native Method)
C 2360.795s Main  	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
C 2360.795s Main  	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
C 2360.795s Main  	at org.chromium.base.test.BaseTestResult.run(BaseTestResult.java:129)
C 2360.795s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C 2360.795s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C 2360.796s Main  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
C 2360.796s Main  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
C 2360.796s Main  
C 2360.796s Main  [FAIL] org.chromium.chrome.browser.autofill.PersonalDataManagerTest#testAddAndEditProfiles:
C 2360.796s Main  junit.framework.AssertionFailedError: expected:<1> but was:<0>
C 2360.796s Main  	at org.chromium.chrome.browser.autofill.PersonalDataManagerTest.testAddAndEditProfiles(PersonalDataManagerTest.java:47)
C 2360.796s Main  	at java.lang.reflect.Method.invokeNative(Native Method)
C 2360.796s Main  	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
C 2360.796s Main  	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
C 2360.796s Main  	at org.chromium.base.test.BaseTestResult.run(BaseTestResult.java:129)
C 2360.796s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
C 2360.796s Main  	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
C 2360.796s Main  	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
C 2360.796s Main  	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
C 2360.796s Main  

 
Cc: rogerm@chromium.org
Components: UI>Browser>Autofill
rogerm@, Has anything changed in personal data manager recently?

Comment 2 by rogerm@chromium.org, Aug 19 2016

I'm not aware of any changes in the last few days, and I haven't found anything in the commit logs that looks related.

One hypothetical source of flakiness could be in the wait for setProfile and setCreditCard to finish (they run on the UiThread and mOnPersonalDataChangedHedlper.waitForCallback(callcount) looks like it can silently return before the waited-for call has actually occurred.

Status: Assigned (was: Unconfirmed)

Comment 4 by hanxi@chromium.org, Aug 25 2016

The same failure observed in "Lollipop Tablet Tester" too: https://uberchromegw.corp.google.com/i/chromium.android/builders/Lollipop%20Tablet%20Tester/builds/4481
I did some digging.

I can repro the failure on a tablet running Lollipop. I reproduced the problem by running two tests PersonalDataManagerTest#testUpdateLanguageCodeInProfile() and PersonalDataManagerTest#testAddAndDeleteProfile() with a high --repeat value (--repeat=4)

A test failure occurs when the "Default retries are being phased out.  crbug.com/619055 " message is printed

When the test fails AutofillTestHelper#setProfile() returns early. It seems that it returns early from an unrelated PersonalDataManager::OnWebDataServiceRequestDone() call (I assume from the previous test)
Labels: -Pri-3 Pri-1
Ping rouslan@ and rogerm@!

When do you think you will have the time look at this bug? I can repro this failure locally. Let me know if you need any help with reproing the test failure.

Do you think that we should temporarily disable the PersonalDataManager tests for the sake of greening up the bots? You are probably super busy.
Status: Started (was: Assigned)
I can start looking into it now. What command did you use to reproduce the problem locally?
rouslan@ I did not do anything special. I deployed on a Nexus 7 running Lollipop 

I ran the tests using out/gn_Debug/bin/run_chrome_public_test_apk -f *PersonalDataManagerTest.* --repeat=4

I narrowed down which tests were problematic by commenting out tests and checking whether there still was a flakily failing test
http://crrev.com/2296943002 has the fix.
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 2 2016

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

commit 33b61506dfd38f489950612a88451ab680bfe431
Author: rouslan <rouslan@chromium.org>
Date: Fri Sep 02 17:57:53 2016

Fix Java PersonalDataManagerTest flake.

Initialization of the PersonalDataManager fires off a
PersonalDataChanged event. If a test is also changing autofill data and
listening for this event, then it may receive the event notification
from initialization instead of the event from its own action. This makes
the test flaky. This patch changes AutofillTestHelper to wait for the
initialization event before starting the test.

BUG= 639138 

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

[modify] https://crrev.com/33b61506dfd38f489950612a88451ab680bfe431/chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java
[modify] https://crrev.com/33b61506dfd38f489950612a88451ab680bfe431/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java
[modify] https://crrev.com/33b61506dfd38f489950612a88451ab680bfe431/chrome/browser/autofill/android/personal_data_manager_android.cc
[modify] https://crrev.com/33b61506dfd38f489950612a88451ab680bfe431/chrome/browser/autofill/android/personal_data_manager_android.h

Status: Fixed (was: Started)

Sign in to add a comment