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

Issue 2893703002: Cleanup PreferenceMACs on browser_tests startup (Closed)

Created:
3 years, 7 months ago by gab
Modified:
3 years, 7 months ago
Reviewers:
jam, grt (UTC plus 2)
CC:
chromium-reviews, jam, darin-cc_chromium.org, grt (UTC plus 2)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Cleanup PreferenceMACs on browser_tests startup and prevent proliferation of scoped_dir subkeys under it in the future. BUG=721245 R=jam@chromium.org Review-Url: https://codereview.chromium.org/2893703002 . Cr-Commit-Position: refs/heads/master@{#472565} Committed: https://chromium.googlesource.com/chromium/src/+/dfcdd8a05d8e0867a68cfc366fb7e7d79b3a318f

Patch Set 1 #

Patch Set 2 : move include to OS_WIN #

Patch Set 3 : re-enable PrefHashBrowserTests disabled for this issue #

Total comments: 9

Patch Set 4 : review:jam #

Total comments: 1

Patch Set 5 : fix compile #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -8 lines) Patch
M base/files/scoped_temp_dir.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M base/files/scoped_temp_dir.cc View 1 2 3 4 chunks +14 lines, -4 lines 0 comments Download
M base/win/registry_unittest.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/base/chrome_test_launcher.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/chrome_test_launcher.cc View 1 2 3 2 chunks +16 lines, -0 lines 2 comments Download
M content/public/test/test_launcher.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/test/test_launcher.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M services/preferences/tracked/registry_hash_store_contents_win.h View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
M services/preferences/tracked/registry_hash_store_contents_win.cc View 1 2 3 2 chunks +12 lines, -1 line 0 comments Download

Messages

Total messages: 37 (22 generated)
gab
John PTaL, thanks!
3 years, 7 months ago (2017-05-17 18:28:13 UTC) #3
jam
Thanks! https://codereview.chromium.org/2893703002/diff/60001/chrome/browser/prefs/tracked/pref_hash_browsertest.cc File chrome/browser/prefs/tracked/pref_hash_browsertest.cc (left): https://codereview.chromium.org/2893703002/diff/60001/chrome/browser/prefs/tracked/pref_hash_browsertest.cc#oldcode522 chrome/browser/prefs/tracked/pref_hash_browsertest.cc:522: // Test is flaky. crbug.com/723639 https://codereview.chromium.org/2882423002 was also ...
3 years, 7 months ago (2017-05-17 19:06:16 UTC) #12
gab
https://codereview.chromium.org/2893703002/diff/60001/chrome/browser/prefs/tracked/pref_hash_browsertest.cc File chrome/browser/prefs/tracked/pref_hash_browsertest.cc (left): https://codereview.chromium.org/2893703002/diff/60001/chrome/browser/prefs/tracked/pref_hash_browsertest.cc#oldcode522 chrome/browser/prefs/tracked/pref_hash_browsertest.cc:522: // Test is flaky. crbug.com/723639 On 2017/05/17 19:06:16, jam ...
3 years, 7 months ago (2017-05-17 20:01:05 UTC) #18
jam
lgtm
3 years, 7 months ago (2017-05-17 20:04:31 UTC) #19
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/2893703002/100001
3 years, 7 months ago (2017-05-17 20:06:00 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/421561)
3 years, 7 months ago (2017-05-17 20:35:15 UTC) #24
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/2893703002/120001
3 years, 7 months ago (2017-05-17 20:44:06 UTC) #27
grt (UTC plus 2)
https://codereview.chromium.org/2893703002/diff/120001/chrome/test/base/chrome_test_launcher.cc File chrome/test/base/chrome_test_launcher.cc (right): https://codereview.chromium.org/2893703002/diff/120001/chrome/test/base/chrome_test_launcher.cc#newcode111 chrome/test/base/chrome_test_launcher.cc:111: key.DeleteKey(L"PreferenceMACs"); for devs like me who use Google Chrome ...
3 years, 7 months ago (2017-05-17 20:52:47 UTC) #28
gab
https://codereview.chromium.org/2893703002/diff/120001/chrome/test/base/chrome_test_launcher.cc File chrome/test/base/chrome_test_launcher.cc (right): https://codereview.chromium.org/2893703002/diff/120001/chrome/test/base/chrome_test_launcher.cc#newcode111 chrome/test/base/chrome_test_launcher.cc:111: key.DeleteKey(L"PreferenceMACs"); On 2017/05/17 20:52:47, grt (UTC plus 2) wrote: ...
3 years, 7 months ago (2017-05-17 20:57:37 UTC) #29
gab
Committed patchset #5 (id:120001) manually as dfcdd8a05d8e0867a68cfc366fb7e7d79b3a318f (presubmit successful).
3 years, 7 months ago (2017-05-17 21:01:20 UTC) #31
gab
On 2017/05/17 21:01:20, gab wrote: > Committed patchset #5 (id:120001) manually as > dfcdd8a05d8e0867a68cfc366fb7e7d79b3a318f (presubmit ...
3 years, 7 months ago (2017-05-17 21:03:39 UTC) #32
grt (UTC plus 2)
It's my understanding that scoped_dirs left in %TEMP% by crashing tests are cleaned up by ...
3 years, 7 months ago (2017-05-17 21:14:24 UTC) #34
gab
On 2017/05/17 21:14:24, grt (UTC plus 2) wrote: > It's my understanding that scoped_dirs left ...
3 years, 7 months ago (2017-05-17 21:24:09 UTC) #35
grt (UTC plus 2)
https://codereview.chromium.org/2893703002/diff/60001/services/preferences/tracked/registry_hash_store_contents_win.cc File services/preferences/tracked/registry_hash_store_contents_win.cc (right): https://codereview.chromium.org/2893703002/diff/60001/services/preferences/tracked/registry_hash_store_contents_win.cc#newcode76 services/preferences/tracked/registry_hash_store_contents_win.cc:76: reset_on_delete_(base::StartsWith(store_key, On 2017/05/17 20:01:05, gab wrote: > On 2017/05/17 ...
3 years, 7 months ago (2017-05-18 08:21:58 UTC) #36
gab
3 years, 7 months ago (2017-05-18 13:50:31 UTC) #37
Message was sent while issue was closed.
On 2017/05/18 08:21:58, grt (UTC plus 2) wrote:
>
https://codereview.chromium.org/2893703002/diff/60001/services/preferences/tr...
> File services/preferences/tracked/registry_hash_store_contents_win.cc (right):
> 
>
https://codereview.chromium.org/2893703002/diff/60001/services/preferences/tr...
> services/preferences/tracked/registry_hash_store_contents_win.cc:76:
> reset_on_delete_(base::StartsWith(store_key,
> On 2017/05/17 20:01:05, gab wrote:
> > On 2017/05/17 19:06:16, jam wrote:
> > > I'm curious, it seems this cleanup code is quite far from the place that's
> > > creating scoped_dir profiles. so there's a risk that as that code changes,
> say
> > > by updating the name, we will forget this part (and also the test
cleanup).
> > > 
> > > is it possible to mark this object at the callsite that knows it's
creating
> a
> > > scoped temp dir?
> > 
> > I debated this too... basically the problem is a test does
> > CreateProfile(scoped_tmp_dir.path(), ...) and that dir eventually trickles
> here.
> > The "faulty" test has no idea it's even triggering this code so asking it to
> > mark anything at the callsite will likely result in someone forgetting to
> > eventually when writing such a test (their test will still pass but will
cause
> > this issue).
> 
> My suggestion on the bug was to create a ScopedProfile object for tests that
> wraps a ScopedTempDir and does the appropriate registry cleanup. This will
> require changing the existing tests, but it keeps the cleanup closer to where
it
> belongs. WDYT?

The problem is that such a ScopedProfile will not be *required* to make a test
that creates a profile in a scoped_dir pass. As such I'm afraid someone will
write such a test one day and we will end up here again a few months later...

Powered by Google App Engine
This is Rietveld 408576698