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

Issue 2815243002: Fix two ContentHashFetcherTest.* tests' flakiness. (Closed)

Created:
3 years, 8 months ago by lazyboy
Modified:
3 years, 8 months ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix two ContentHashFetcherTest.* tests' flakiness. ContentHashFetcherJob::url_fetcher_ is always created on ContentHashFetcherJob::creation_thread_ but it was possible for it to be destroyed on blocking pool with the destruction of ContentHashFetcherJob. This causes test flakiness, and this CL makes sure we always destroy url_fetcher_ on correct thread. As an optimization for the most common case, also destroy ContentHashFetcherJob::url_fetcher_ once we're done with it (earlier than above). However, note that because jobs can be cancelled, we still need to make sure to destroy url_fetcher_ on correct thread from ContentHashFetcherJob destructor. BUG=702300 Test=No visible change. Fixing test flakiness and potential ref issue in content verification code. To repro the flake, I have put my machine on heavy load (compiling chromium without goma and -j 1024), then ran these tests repeatedly with --gtest_repeat flag. Tests will be flaky without this change, but they always pass with this CL. Review-Url: https://codereview.chromium.org/2815243002 Cr-Commit-Position: refs/heads/master@{#465468} Committed: https://chromium.googlesource.com/chromium/src/+/825099a68908767ecd35d79b0888887c4ffccd0b

Patch Set 1 #

Total comments: 5

Patch Set 2 : REWORK #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -18 lines) Patch
M extensions/browser/content_hash_fetcher.cc View 1 3 chunks +13 lines, -2 lines 1 comment Download
M extensions/browser/content_hash_fetcher_unittest.cc View 2 chunks +2 lines, -16 lines 0 comments Download

Messages

Total messages: 24 (15 generated)
lazyboy
Hi Devlin, this ref detaching seems to make the two tests always pass now.
3 years, 8 months ago (2017-04-13 01:55:07 UTC) #3
lazyboy
https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc File extensions/browser/content_hash_fetcher.cc (right): https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc#newcode448 extensions/browser/content_hash_fetcher.cc:448: url_fetcher_.reset(); btw, this is the reset that's necessary for ...
3 years, 8 months ago (2017-04-13 02:06:36 UTC) #6
Devlin
https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc File extensions/browser/content_hash_fetcher.cc (right): https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc#newcode211 extensions/browser/content_hash_fetcher.cc:211: url_fetcher_.reset(); nit: We can get rid of cancelled_ now ...
3 years, 8 months ago (2017-04-13 15:12:19 UTC) #9
lazyboy
Thanks for checking. Reply below, I'll address the other comment once we settle on this... ...
3 years, 8 months ago (2017-04-13 16:06:25 UTC) #10
Devlin
https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc File extensions/browser/content_hash_fetcher.cc (right): https://codereview.chromium.org/2815243002/diff/1/extensions/browser/content_hash_fetcher.cc#newcode448 extensions/browser/content_hash_fetcher.cc:448: url_fetcher_.reset(); On 2017/04/13 16:06:24, lazyboy wrote: > On 2017/04/13 ...
3 years, 8 months ago (2017-04-13 16:24:45 UTC) #11
lazyboy
CL updated to destroy URLFetcher correctly, a little bit different than what we exactly discussed, ...
3 years, 8 months ago (2017-04-19 00:19:33 UTC) #14
Devlin
lgtm, thanks for the great investigative work here!
3 years, 8 months ago (2017-04-19 00:29:14 UTC) #17
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/2815243002/20001
3 years, 8 months ago (2017-04-19 02:08:09 UTC) #21
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 02:12:17 UTC) #24
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/825099a68908767ecd35d79b0888...

Powered by Google App Engine
This is Rietveld 408576698