|
|
Created:
7 years, 3 months ago by clamy Modified:
6 years, 11 months ago CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
DescriptionSimpleCache: have tests run on all three streams
Many unit tests only run on the first stream. With the upcoming changes to
SimpleCache, each stream will have a different implementation. This CL ensures
test are ran on all streams.
BUG=173398
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243170
Patch Set 1 : #Patch Set 2 : #Patch Set 3 : No testing for stream 2 in DoomedEntry #
Total comments: 4
Patch Set 4 : Addressed pasko's comments #Patch Set 5 : Fixed a test issue with optimistic operations on stream 0 #Messages
Total messages: 15 (0 generated)
pasko, gavinp: PTAL. This is intended to go along with https://chromiumcodereview.appspot.com/23983005/ (the stream merge).
Thanks, Camille, this looks useful. Running CleanupCacheDir() in many tests is a good choice, since it would avoid breaking tests that could assume some entries are not created. Though a cache backend could remain some leftover entries _after_ we cleaned up the cache directory. This could result in flakiness, which would be hard to debug. How about adding DoomAllEntries? Its flakiness is soon going away. We can add it just before CleanupCacheDir() to be sure. Here is my random thoughts on what we could do instead: 1. destroy the backend between invocations (with the current testing infrastructure I believe this would require adding an extra TEST for each stream index, which is an overkill 2. wait until all backend operations are finished (there was a hackish flaky way to make almost that: helper.WaitUntilCacheIoFinished(1);) 3. run using a different backend instance with a newly created directory (this would require replacing simple_cache_impl_ and cache_ with a new instance) looking hackish as well 4. manually run TearDown() and SetUp() inside a test? I believe nobody is doing that, consequences unknown. More ideas are welcome.
On 2013/09/10 14:35:53, pasko wrote: > Thanks, Camille, this looks useful. > > Running CleanupCacheDir() in many tests is a good choice, since it would avoid > breaking tests that could assume some entries are not created. > > Though a cache backend could remain some leftover entries _after_ we cleaned up > the cache directory. This could result in flakiness, which would be hard to > debug. > > How about adding DoomAllEntries? Its flakiness is soon going away. We can add it > just before CleanupCacheDir() to be sure. > > Here is my random thoughts on what we could do instead: > 1. destroy the backend between invocations (with the current testing > infrastructure I believe this would require adding an extra TEST for each stream > index, which is an overkill > 2. wait until all backend operations are finished (there was a hackish flaky way > to make almost that: helper.WaitUntilCacheIoFinished(1);) > 3. run using a different backend instance with a newly created directory (this > would require replacing simple_cache_impl_ and cache_ with a new instance) > looking hackish as well > 4. manually run TearDown() and SetUp() inside a test? I believe nobody is doing > that, consequences unknown. > > More ideas are welcome. Adding a DoomAllEntries seems fine to me. I decided on using CleanupCacheDir after considering 1, 3 and 4 (and raising about the same points as you do). 2) I don't know about that one. If it is flaky, maybe we should use DoomAllEntries instead.
egor, gavin: PTAL In this version, SimpleCacheNonSequentialWrite seem to have no race condition - and this is the test that caught the crc32 bug fixed in https://chromiumcodereview.appspot.com/24251005/ I am working on a version of SimpleCacheNonSequentialWrite that has a race conditions because of DoomAllEntries, and will upload that in another CL.
On 2013/09/19 13:39:06, clamy wrote: > egor, gavin: PTAL > > In this version, SimpleCacheNonSequentialWrite seem to have no race condition - > and this is the test that caught the crc32 bug fixed in > https://chromiumcodereview.appspot.com/24251005/ > > I am working on a version of SimpleCacheNonSequentialWrite that has a race > conditions because of DoomAllEntries, and will upload that in another CL. FYI: some tests fail because writes on stream 2 now produce errors on doomed entries
I stopped testing on stream 2 in the DoomdEntry test. The other ones seem ok.
lgtm given two comments below are addressed. https://codereview.chromium.org/23702024/diff/31001/net/disk_cache/entry_unit... File net/disk_cache/entry_unittest.cc (left): https://codereview.chromium.org/23702024/diff/31001/net/disk_cache/entry_unit... net/disk_cache/entry_unittest.cc:3469: EXPECT_EQ(entry, entry2); why removing this check? rebase gone out of control? https://codereview.chromium.org/23702024/diff/31001/net/disk_cache/entry_unit... File net/disk_cache/entry_unittest.cc (right): https://codereview.chromium.org/23702024/diff/31001/net/disk_cache/entry_unit... net/disk_cache/entry_unittest.cc:2461: // APP_CACHE does not use optimistic operations, and this test needs non // Proving that the test works well with optimistic operations enabled is subtle, instead run only in APP_CACHE mode to disable optimistic operations. And stream 0 is not special.
Thanks for the review! I'll be waiting on Gavin's one when he's back from vacation. https://chromiumcodereview.appspot.com/23702024/diff/31001/net/disk_cache/ent... File net/disk_cache/entry_unittest.cc (left): https://chromiumcodereview.appspot.com/23702024/diff/31001/net/disk_cache/ent... net/disk_cache/entry_unittest.cc:3469: EXPECT_EQ(entry, entry2); On 2013/11/21 13:02:21, pasko wrote: > why removing this check? rebase gone out of control? This check does not make any sense since entry has just been closed 3 lines before. So it is effectively a dangling pointer. Also, the entry itself could have been taken out of the list of active entry, so when queried again we would get a new pointer and the check would fail. https://chromiumcodereview.appspot.com/23702024/diff/31001/net/disk_cache/ent... File net/disk_cache/entry_unittest.cc (right): https://chromiumcodereview.appspot.com/23702024/diff/31001/net/disk_cache/ent... net/disk_cache/entry_unittest.cc:2461: // APP_CACHE does not use optimistic operations, and this test needs non On 2013/11/21 13:02:21, pasko wrote: > // Proving that the test works well with optimistic operations enabled is > subtle, instead run only in APP_CACHE mode to disable optimistic operations. > > And stream 0 is not special. Done.
still lgtm.
gavinp: ping
lgtm. Thanks for the ping!
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/clamy@chromium.org/23702024/131001
Retried try job too often on linux_rel for step(s) net_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&...
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/clamy@chromium.org/23702024/401001
Message was sent while issue was closed.
Change committed as 243170 |