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

Issue 2482833002: Reland of predictors: Basic browsertest checks predictor learning. (Closed)

Created:
4 years, 1 month ago by alexilin
Modified:
4 years, 1 month ago
Reviewers:
pasko, Benoit L
CC:
chromium-reviews, shishir+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland of predictors: Basic browsertest checks predictor learning. Reason for reland: The reason of the test flakiness was fixed. ResourcePrefetchPredictor needs to be initialized before learn any data. Initialization starts when the first main frame load complete for given profile. In our case it was about:blank page after tab creation. This initialization requires work in DB thread to be done. So there was a race condition in which next navigation could appear earlier than initialization in DB thread will be done. This bug could be easily reproduced by adding sleep in ResourcePrefetchPredictorTables::GetAllData function. For now we explicitly check that initialization of ResourcePrefetchPredictor was done before any navigation. Original issue's description: > Revert of predictors: Basic browsertest checks predictor learning. (patchset #9 id:160001 of https://codereview.chromium.org/2449323005/ ) > > Reason for revert: > Created a flaky test: first occurrence at > > https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/28933 > > Original issue's description: > > predictors: Basic browsertest checks predictor learning. > > > > First stage for implementing ResourcePrefetchPredictor browsertests is to check > > that the prefetch database is really filled after some navigations in browser. > > Browsertest class provides convenient way to declare expected resources in the > > test and then checks expectations internally that allows to write readable > > tests. > > > > BUG=650253 > > > > Committed: https://crrev.com/e636e3bcc172f220dfadfd2121d238c9908185bb > > Cr-Commit-Position: refs/heads/master@{#429966} > > TBR=pasko@chromium.org,lizeb@chromium.org,alexilin@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=650253 > > Committed: https://crrev.com/3250e71949fa7d226e9c843ee28277b988306229 > Cr-Commit-Position: refs/heads/master@{#430137} BUG=650253 Committed: https://crrev.com/f2d707775a8184e7bd18d2334ff2a679f3a90439 Cr-Commit-Position: refs/heads/master@{#430561}

Patch Set 1 #

Patch Set 2 : Wait for ResourcePrefetchPredictor initialization. #

Total comments: 2

Patch Set 3 : Ensure initialization earlier. #

Patch Set 4 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -41 lines) Patch
M chrome/browser/predictors/resource_prefetch_predictor.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc View 1 2 1 chunk +220 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_test_util.h View 1 2 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_test_util.cc View 1 1 chunk +46 lines, -0 lines 0 comments Download
M chrome/browser/predictors/resource_prefetch_predictor_unittest.cc View 1 1 chunk +0 lines, -41 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/test/data/predictors/html_subresources.html View 1 chunk +22 lines, -0 lines 0 comments Download
M testing/buildbot/filters/browser-side-navigation.linux.browser_tests.filter View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (14 generated)
alexilin
Created Reland of predictors: Basic browsertest checks predictor learning.
4 years, 1 month ago (2016-11-07 09:52:56 UTC) #1
pasko
I assume this should wait until we have a better idea of the reasons of ...
4 years, 1 month ago (2016-11-07 13:36:04 UTC) #2
Benoit L
https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc File chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc (right): https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc#newcode113 chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc:113: EnsurePredictorInitialized(); This would be better in SetUp(), since we're ...
4 years, 1 month ago (2016-11-07 17:17:07 UTC) #8
alexilin
Hi all! I've found problem in browser tests for ResourcePrefetchPredictor. The issue description should be ...
4 years, 1 month ago (2016-11-07 17:17:12 UTC) #9
alexilin
https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc File chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc (right): https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc#newcode113 chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc:113: EnsurePredictorInitialized(); On 2016/11/07 17:17:06, Benoit L wrote: > This ...
4 years, 1 month ago (2016-11-07 17:19:51 UTC) #10
Benoit L
On 2016/11/07 17:19:51, alexilin wrote: > https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc > File chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc > (right): > > https://codereview.chromium.org/2482833002/diff/170001/chrome/browser/predictors/resource_prefetch_predictor_browsertest.cc#newcode113 ...
4 years, 1 month ago (2016-11-07 17:23:35 UTC) #11
pasko
lgtm nit: description: s/^Reason for revert:/Reason for reland:/ did you repro the flake by artificially ...
4 years, 1 month ago (2016-11-07 19:09:36 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2482833002/200001
4 years, 1 month ago (2016-11-08 09:56:17 UTC) #20
commit-bot: I haz the power
Failed to apply the patch. On branch working_branch Your branch is up-to-date with 'origin/refs/pending/heads/master'. nothing ...
4 years, 1 month ago (2016-11-08 10:03:03 UTC) #22
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/f2d707775a8184e7bd18d2334ff2a679f3a90439 Cr-Commit-Position: refs/heads/master@{#430561}
4 years, 1 month ago (2016-11-08 10:03:26 UTC) #24
alexilin
4 years, 1 month ago (2016-11-08 10:06:52 UTC) #25
Message was sent while issue was closed.
pasko@: yes, I was able to reproduce this bug by slowing task in DB thread. I
suspected that this DB thread blocking could prevent some other browser
initialization needed to run navigation but no such thing.
Unittest for predictor also contains the similar initialization workaround thus
I had to be more careful with it in the browsertest.
https://cs.chromium.org/chromium/src/chrome/browser/predictors/resource_prefe...

Powered by Google App Engine
This is Rietveld 408576698