After importing W3C media tests, we started to get so many cached media files that it started to make tests very slow, often timing out. This looks like a CoreMedia bug that is fixed in Yosemite. I'd like to take this opportunity to add cleanup that works on newer systems too though.
Created attachment 261753 [details] proposed fix
On Yosemite WK2, the media cache goes into TMPDIR/com.apple.WebKit.WebContent.Development+WebKitTestRunner/MediaCache, which is also a global directory that should not persist between test runs. I'll look into moving it under an ephemeral WebKitTestRunner directory separately.
Comment on attachment 261753 [details] proposed fix r=me
Comment on attachment 261753 [details] proposed fix Hmm, not quite right. Some Yosemite bots still put the cache into /private/tmp.
Created attachment 261755 [details] patch for landing Made deleting /private/tmp/MediaCache unconditional. Looks like it's used on Yosemite in DumpRenderTree, but not in WebKitTestRunner. That seems wrong, and may need separate investigation.
Comment on attachment 261755 [details] patch for landing Clearing flags on attachment: 261755 Committed r190127: <http://trac.webkit.org/changeset/190127>
All reviewed patches have been landed. Closing bug.
Re-opening for a better fix.
Created attachment 261908 [details] better fix
Attachment 261908 [details] did not pass style-queue: ERROR: Tools/Scripts/webkitpy/port/mac.py:117: multiple statements on one line (semicolon) [pep8/E702] [5] Total errors found: 1 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 261909 [details] better fix Removed a stray semicolon.
Comment on attachment 261909 [details] better fix View in context: https://bugs.webkit.org/attachment.cgi?id=261909&action=review > Source/WebKit2/Shared/ios/ChildProcessIOS.mm:77 > + String defaultUserDirectorySuffix = String([[NSBundle mainBundle] bundleIdentifier]) + "+" + parameters.clientIdentifier; I think this would read nicer with makeString rather than the typecast, and we could use a character instead of a string for '+'. > Source/WebKit2/Shared/mac/ChildProcessMac.mm:94 > + auto userDirectorySuffix = parameters.extraInitializationData.find(ASCIILiteral("user-directory-suffix")); I don’t think we have an efficient version of find that takes ASCIILiteral. In fact that might force allocation of a String and skipping the more efficient override for const char*. We could add an override for ASCIILiteral, or we could just omit ASCIILiteral here and get better efficiency. > Source/WebKit2/Shared/mac/ChildProcessMac.mm:96 > + sandboxParameters.setUserDirectorySuffix([(String)(userDirectorySuffix->value + ASCIILiteral("/") + String([[NSBundle mainBundle] bundleIdentifier])) fileSystemRepresentation]); I think that using makeString we can write this without all the typecasts and ASCIILiteral stuff. > Source/WebKit2/Shared/mac/ChildProcessMac.mm:98 > + String defaultUserDirectorySuffix = String([[NSBundle mainBundle] bundleIdentifier]) + "+" + parameters.clientIdentifier; I think this would read nicer with makeString rather than the typecast, and we could use a character instead of a string for '+'.
Created attachment 261927 [details] better fix, patch for landing Thank you for the great suggestions!
Created attachment 261930 [details] better fix, patch for landing
Comment on attachment 261930 [details] better fix, patch for landing Clearing flags on attachment: 261930 Committed r190257: <http://trac.webkit.org/changeset/190257>