Bug 197040

Summary: [Mac iOS WK2] Layout Test http/wpt/cache-storage/cache-quota-after-restart.any.html is a flaky failure
Product: WebKit Reporter: Shawn Roberts <sroberts>
Component: Tools / TestsAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, cgarcia, commit-queue, ews-watchlist, koivisto, lforschler, webkit-bot-watchers-bugzilla, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Shawn Roberts 2019-04-17 16:36:32 PDT
The following layout test is failing on Mac WK2, iOS Simulator WK2 Release and Debug

http/wpt/cache-storage/cache-quota-after-restart.any.html

Probable cause:

test was added in https://trac.webkit.org/changeset/243276/webkit and has been a flaky failure since added. iOS Simulator Release fails the most, but has been seen on other queues as well. 

Flakiness Dashboard:

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Fwpt%2Fcache-storage%2Fcache-quota-after-restart.any.html

Diff:

--- /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/http/wpt/cache-storage/cache-quota-after-restart.any-expected.txt
+++ /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/http/wpt/cache-storage/cache-quota-after-restart.any-actual.txt
@@ -1,7 +1,8 @@
-CONSOLE MESSAGE: Cache API operation failed: Quota exceeded
 CONSOLE MESSAGE: Cache API operation failed: Quota exceeded
 
+Harness Error (TIMEOUT), message = null
+
 PASS Increasing quota 
-PASS After network process restart, verify quota is computed according space being used 
-PASS After network process restart, verify quota is computed according space being used and does not increase 
+TIMEOUT After network process restart, verify quota is computed according space being used Test timed out
+NOTRUN After network process restart, verify quota is computed according space being used and does not increase
Comment 1 Radar WebKit Bug Importer 2019-04-17 16:37:06 PDT
<rdar://problem/49997641>
Comment 2 youenn fablet 2019-04-23 14:42:24 PDT
There are two issues there:
- Test on iOS might be very slow so we should mark it this way in TestExpectations.
- Sometimes, disk writing fails. Doing some logging in NetworkCache::Storage, it seems that between the time we call Storage::dispatchWriteOperation and create the folder where to write using FileSystem::makeAllDirectories and the actual write operation in IOChannel::write, the folder get deleted. Sometimes the call to FileSystem::makeAllDirectories fails as well. Doing some logging, I do not see any calls to remove these folders from another thread.
Comment 3 youenn fablet 2019-04-24 13:13:09 PDT
As spotted by Antti, the synchronize mechanism is probably the one deleting the folder that has just been created.
This probably happens as write and synchronize share the same background queue and the queue is concurrent.
Comment 4 youenn fablet 2019-04-24 13:23:03 PDT
Created attachment 368167 [details]
Patch
Comment 5 WebKit Commit Bot 2019-04-25 08:50:24 PDT
Comment on attachment 368167 [details]
Patch

Clearing flags on attachment: 368167

Committed r244645: <https://trac.webkit.org/changeset/244645>
Comment 6 WebKit Commit Bot 2019-04-25 08:50:25 PDT
All reviewed patches have been landed.  Closing bug.