Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Issue 1517883003: [Contextual Search] Reset all counters to fix flaky tests. (Closed)

Created:
5 years ago by Donn Denman
Modified:
4 years, 11 months ago
Reviewers:
Theresa, newt (away)
CC:
chromium-reviews, Theresa, mdjones, newt (away)
Base URL:
https://chromium.googlesource.com/chromium/src.git@4t
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Contextual Search] Reset all counters to fix a flaky test. At least one test that relies on counters was flaky because counters were not being consistently reset for testing. The counter resetting code was inexplicably calling code to update counters as if an open action had occurred (removed). This change may fix other flaky tests. Update the test code to just reset all preferences instead of trying to remember to add reset code when adding a new counter. Fixes testLongPressShowsPeekPromo. BUG=540820, 569123 Committed: https://crrev.com/0eefcd63e6c76de96bf16b9297414f1756e7f649 Cr-Commit-Position: refs/heads/master@{#371353}

Patch Set 1 #

Patch Set 2 : Trivial (no longer dependent on other patches). #

Patch Set 3 : Added required import #

Total comments: 1

Patch Set 4 : Fix the root problem -- resetting the counters for testing. #

Patch Set 5 : Updated a comment in ChromePreferenceManager to remind callers to reset counters. #

Patch Set 6 : Only unflake the new promo test. #

Total comments: 4

Patch Set 7 : Use a blocking call to reset CS counters. #

Total comments: 2

Patch Set 8 : Reset all shared preferences when starting up the ContextualSearchManagerTest. #

Patch Set 9 : Revert changes to ChromePreferenceManager.java except for white-space. #

Total comments: 2

Patch Set 10 : Fixed a nit comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -44 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPolicy.java View 1 2 3 4 5 6 7 4 chunks +4 lines, -20 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java View 1 2 3 4 5 6 7 8 9 5 chunks +8 lines, -24 lines 0 comments Download

Messages

Total messages: 39 (17 generated)
Donn Denman
Trivial (no longer dependent on other patches).
5 years ago (2015-12-15 19:23:54 UTC) #1
Donn Denman
Added required import
5 years ago (2015-12-15 19:38:44 UTC) #2
Donn Denman
Theresa, PTAL.
5 years ago (2015-12-15 19:41:49 UTC) #4
Theresa
https://chromiumcodereview.appspot.com/1517883003/diff/40001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://chromiumcodereview.appspot.com/1517883003/diff/40001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode2185 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:2185: assertEquals(0, mPolicy.getPromoOpenCount()); Is it possible that this test is ...
5 years ago (2015-12-15 20:28:10 UTC) #5
Donn Denman
On 2015/12/15 20:28:10, Theresa Wellington wrote: > https://chromiumcodereview.appspot.com/1517883003/diff/40001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java > File > chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java > (right): > ...
4 years, 11 months ago (2016-01-21 23:51:48 UTC) #9
Donn Denman
Theresa, PTAL. Newt, PTAL at the comment added to ChromePreferenceManager (and let me know if ...
4 years, 11 months ago (2016-01-21 23:52:54 UTC) #11
Donn Denman
Not ready yet: I want to test this some more. Will ping you again when ...
4 years, 11 months ago (2016-01-21 23:57:55 UTC) #13
Donn Denman
Theresa, PTAL. Newt, PTAL at the comment added to ChromePreferenceManager (and let me know if ...
4 years, 11 months ago (2016-01-22 22:01:15 UTC) #16
newt (away)
https://codereview.chromium.org/1517883003/diff/100001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1517883003/diff/100001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode114 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:114: resetCounters(); Why do you need to call this? ChromeActivityTestCaseBase.setUp() ...
4 years, 11 months ago (2016-01-22 23:06:54 UTC) #17
Donn Denman
Newt, PTAL at your convenience. And thanks for the suggestion and raising the clear-data issue ...
4 years, 11 months ago (2016-01-23 01:07:43 UTC) #18
newt (away)
Looks better :) Instead of clearing individual prefs, how about clearing all shared prefs? That ...
4 years, 11 months ago (2016-01-23 01:19:44 UTC) #19
Donn Denman
Newt, PTAL, and thanks for the suggestions! I'm going in send more CLs your way ...
4 years, 11 months ago (2016-01-25 19:31:29 UTC) #20
Donn Denman
Newt, All we have left for you is a white-space cleaup.
4 years, 11 months ago (2016-01-25 19:36:37 UTC) #24
Theresa
lgtm https://codereview.chromium.org/1517883003/diff/160001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1517883003/diff/160001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode1366 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:1366: // TODO(donnd): consider using to runOnUiThreadBlocking, won't need ...
4 years, 11 months ago (2016-01-25 19:41:07 UTC) #25
Donn Denman
Thanks! https://codereview.chromium.org/1517883003/diff/160001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java (right): https://codereview.chromium.org/1517883003/diff/160001/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java#newcode1366 chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java:1366: // TODO(donnd): consider using to runOnUiThreadBlocking, won't need ...
4 years, 11 months ago (2016-01-25 20:31:39 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1517883003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1517883003/180001
4 years, 11 months ago (2016-01-25 20:33:46 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/138716)
4 years, 11 months ago (2016-01-25 20:46:55 UTC) #31
Donn Denman
Newt, still need your LGTM for a whitespace change to ChromePreferenceManager.java
4 years, 11 months ago (2016-01-25 20:54:55 UTC) #32
newt (away)
lgtm
4 years, 11 months ago (2016-01-25 23:01:40 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1517883003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1517883003/180001
4 years, 11 months ago (2016-01-25 23:16:57 UTC) #35
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 11 months ago (2016-01-25 23:58:52 UTC) #37
commit-bot: I haz the power
4 years, 11 months ago (2016-01-26 00:00:59 UTC) #39
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/0eefcd63e6c76de96bf16b9297414f1756e7f649
Cr-Commit-Position: refs/heads/master@{#371353}

Powered by Google App Engine
This is Rietveld 408576698