Bug 134918 - DRT/WTR should clear the memory cache between tests
Summary: DRT/WTR should clear the memory cache between tests
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-14 23:03 PDT by Simon Fraser (smfr)
Modified: 2015-08-05 10:33 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2014-07-14 23:03:05 PDT
DRT doesn't seem to clear the memory cache between tests. I was trying to make a test that has window.internals.settings.setImageSubsamplingEnabled(true); and a ref test that does not, but the CachedImage was created by the test then just re-used by the reference, giving me a bogus pass.
Comment 1 Simon Fraser (smfr) 2015-08-05 09:03:28 PDT
Antti says:
I think that is a too big of a hammer. You can use internals.clearMemoryCache() if your test relies on empty memory cache.
Comment 2 Chris Dumez 2015-08-05 09:20:16 PDT
I am personally in favor of this change. I will help reduce flakiness. I had to add internals.clearMemoryCache() calls at the beginning of 24 tests recently to make them not flaky, I don't think this is very scalable. We already disable PageCache during testing, I think it makes sense to make the MemoryCache opt-in as well.
Comment 3 Chris Dumez 2015-08-05 09:21:49 PDT
(In reply to comment #2)
> I am personally in favor of this change. I will help reduce flakiness. I had
> to add internals.clearMemoryCache() calls at the beginning of 24 tests
> recently to make them not flaky, I don't think this is very scalable. We
> already disable PageCache during testing, I think it makes sense to make the
> MemoryCache opt-in as well.

I would also add that I wasted engineering time investigating the source of the flakiness until I was able to determine the reason was the memory cache. This WILL happen again and more people WILL waste time on this.
Comment 4 Simon Fraser (smfr) 2015-08-05 09:31:35 PDT
Reopening.
Comment 5 Alexey Proskuryakov 2015-08-05 09:38:12 PDT
One concern if that *may* make the tests substantially slower. We'll need to measure performance if we do this.
Comment 6 Antti Koivisto 2015-08-05 10:33:01 PDT
internals.clearMemoryCache is not to meant to be flakiness fix but used when a test actually relies on having a clear cache.

Doing it everywhere would slow down tests (no idea if enough to matter) and reduce implicit test coverage, moving testing further from real browser behavior in general.