New issue
Advanced search Search tips

Issue 706179 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

"ContextualSearchManagerTest#testSwipeExpand" is flaky

Project Member Reported by chromium...@appspot.gserviceaccount.com, Mar 28 2017

Issue description

"org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest#testSwipeExpand" is flaky.

This issue was created automatically by the chromium-try-flakes app. Please find the right owner to fix the respective test/step and assign this issue to them. If the step/test is infrastructure-related, please add Infra-Troopers label and change issue status to Untriaged. When done, please remove the issue from Sheriff Bug Queue by removing the Sheriff-Chromium label.

We have detected 3 recent flakes. List of all flakes can be found at https://chromium-try-flakes.appspot.com/all_flake_occurrences?key=ahVzfmNocm9taXVtLXRyeS1mbGFrZXNyYwsSBUZsYWtlIlhvcmcuY2hyb21pdW0uY2hyb21lLmJyb3dzZXIuY29udGV4dHVhbHNlYXJjaC5Db250ZXh0dWFsU2VhcmNoTWFuYWdlclRlc3QjdGVzdFN3aXBlRXhwYW5kDA.

Flaky tests should be disabled within 30 minutes unless culprit CL is found and reverted. Please see more details here: https://sites.google.com/a/chromium.org/dev/developers/tree-sheriffs/sheriffing-bug-queues#triaging-auto-filed-flakiness-bugs
 
Cc: donnd@chromium.org twelling...@chromium.org
+cc nearest owners

Comment 2 by donnd@chromium.org, Mar 29 2017

Cc: mdjones@chromium.org
Components: UI>Browser>Search>ContextualSearch
Owner: donnd@chromium.org
Status: Assigned (was: Untriaged)
Summary: "ContextualSearchManagerTest#testSwipeExpand" is flaky (was: "org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest#testSwipeExpand" is flaky)
Looks like we've had quite a few flakes with this basic test of swiping to expand since yesterday.  I suspect the CL to skip the expanded state that landed yesterday somehow caused this flake: https://chromiumcodereview.appspot.com/2781563002/ 

Comment 3 by donnd@chromium.org, Mar 29 2017

Seems simplest to just disable the test, so I wrote this CL, trying to land now: https://chromiumcodereview.appspot.com/2780083002/
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 29 2017

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

commit c82ee4e2a7a6c18189c6945d929420e54460617a
Author: donnd <donnd@chromium.org>
Date: Wed Mar 29 05:22:32 2017

[TTS] Disable flaky testSwipeExpand.

Disabling this test is not too risky since it mostly tests
a very common gesture.

TBR=twellington

BUG= 706179 

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

[modify] https://crrev.com/c82ee4e2a7a6c18189c6945d929420e54460617a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java

Comment 5 by finnur@chromium.org, Mar 29 2017

Labels: -Sheriff-Chromium

Comment 6 by donnd@chromium.org, Mar 29 2017

Owner: mdjones@chromium.org
Matt, assigning to you to at least verify whether your CL caused this flake (https://chromiumcodereview.appspot.com/2781563002/).  Feel free to just send me some guesses or advice and bounce back to me if you'd rather not!

Comment 7 by donnd@chromium.org, Mar 29 2017

Stack trace and flakes history:

https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest%23testSwipeExpand
org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest#testSwipeExpand (run #1):
junit.framework.AssertionFailedError: Panel did not enter EXPANDED state. Instead, the current state is PEEKED.
	at org.chromium.content.browser.test.util.CriteriaHelper.pollInstrumentationThread(CriteriaHelper.java:79)
	at org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.waitForPanelToEnterState(ContextualSearchManagerTest.java:767)
	at org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.waitForPanelToExpand(ContextualSearchManagerTest.java:742)
	at org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.testSwipeExpand(ContextualSearchManagerTest.java:1201)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
	at org.chromium.chrome.test.ChromeActivityTestCaseBase.runTest(ChromeActivityTestCaseBase.java:758)
	at org.chromium.base.test.BaseTestResult.runParameterized(BaseTestResult.java:161)
	at org.chromium.base.test.BaseTestResult.run(BaseTestResult.java:124)
	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)

I suspect that the current velocity is 0 in the flake cases for whatever reason. The fix could be as simple as changing > to >= in the following code:

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java?rcl=05eae9e2267ccd7d3cf5387339e34badb1e0a88e&l=227

if (mCurrentSwipeVelocity > 0 && state == PanelState.EXPANDED) return false;

To me, the bigger question is why the test gesture would produce a velocity of 0.

Comment 9 by donnd@chromium.org, Mar 30 2017

Owner: donnd@chromium.org
Status: Started (was: Assigned)
Trying that now...

Comment 10 by donnd@chromium.org, Mar 30 2017

Strange, I got a completely different failure when trying my patch https://chromiumcodereview.appspot.com/2785903002/

Looks like it's not failing without this patch:
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest%23testQuickActionCaptionAndImage


I  943.422s run_tests_on_device(03852b9e003b9f11)    Failure in testQuickActionCaptionAndImage:
I  943.422s run_tests_on_device(03852b9e003b9f11)    junit.framework.AssertionFailedError: expected:<Open in new tab> but was:<Call>
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at org.chromium.chrome.browser.contextualsearch.ContextualSearchManagerTest.testQuickActionCaptionAndImage(ContextualSearchManagerTest.java:2814)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at java.lang.reflect.Method.invokeNative(Native Method)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at org.chromium.chrome.test.ChromeActivityTestCaseBase.runTest(ChromeActivityTestCaseBase.java:758)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at org.chromium.base.test.BaseTestResult.runParameterized(BaseTestResult.java:161)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at org.chromium.base.test.BaseTestResult.run(BaseTestResult.java:124)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
I  943.422s run_tests_on_device(03852b9e003b9f11)    	at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554)
I  943.423s run_tests_on_device(03852b9e003b9f11)    	at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)

My guess is that something has not detected that the panel has expanded so it still shows the "Call" action instead of the "Open in new tab" action.

I'll keep investigating!

Comment 11 by donnd@chromium.org, Mar 30 2017

Matt and Theresa, changing that line in #8 actually causes a regression in quick actions that the test in #10 detected:

if (mCurrentSwipeVelocity >= 0 && state == PanelState.EXPANDED) return false;

Causes tapping on the right side of the bar to expand and it doesn't update the bar contents, it continues to show the Call icon and "call" quick action.

My hunch is we need to only return false when the panel is going from the maximized state, so maybe we need to check directionality too?  Does that sound reasonable?

Comment 12 by donnd@chromium.org, Mar 30 2017

Labels: -Pri-1 Pri-2
Status: Available (was: Started)
Repeated testing shows that testSwipeExpand is still flaky even with the ">=" change, so this needs more work.

I think we're OK leaving this as-is for now because the code is doing what we want and the problem test that's disabled is not very important.  We can revisit this later.

Comment 13 by donnd@chromium.org, Mar 30 2017

Labels: -Pri-2 Pri-1
Status: Started (was: Available)
> the code is doing what we want
Double-checked this and found that there is a regression in Canary now ( identified in #10 -- Caption doesn't change correctly), but only after the variable is set by swiping through the expanded state.  I'll try clearing it.
Project Member

Comment 14 by bugdroid1@chromium.org, Mar 31 2017

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

commit 4e3a8e8773e17842197072f1add49917adbaca16
Author: donnd <donnd@chromium.org>
Date: Fri Mar 31 23:19:48 2017

[TTS] Skip expanded state when swiping down v2.

The approach taken in CL 2780083002 had some minor problems.
This reverts that approach and instead checks in getProjectedState
whether we're doing the MAXIMIZED==>EXPANDED transition and
projects to PEEKED instead.

Also reenables testSwipeExpand.

BUG= 706179 

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

[modify] https://crrev.com/4e3a8e8773e17842197072f1add49917adbaca16/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
[modify] https://crrev.com/4e3a8e8773e17842197072f1add49917adbaca16/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java

Comment 15 by donnd@chromium.org, Apr 12 2017

Status: Fixed (was: Started)

Sign in to add a comment