RESOLVED FIXED 237065
[macOS] TestWebKitAPI.WebKit.MigrateLocalStorageDataToGeneralStorageDirectory is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=237065
Summary [macOS] TestWebKitAPI.WebKit.MigrateLocalStorageDataToGeneralStorageDirectory...
Ryan Haddad
Reported 2022-02-22 16:44:22 PST
TestWebKitAPI.WebKit.MigrateLocalStorageDataToGeneralStorageDirectory, added with https://commits.webkit.org/247316@main, is a flaky failure on macOS bots TestWebKitAPI.WebKit.MigrateLocalStorageDataToGeneralStorageDirectory LEAK: 1 WebProcessPool /Volumes/Data/worker/monterey-debug/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:864 Expected equality of these values: "testvalue" getNextMessage().body Which is: "[null]" https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WebKit.MigrateLocalStorageDataToGeneralStorageDirectory
Attachments
Patch (4.54 KB, patch)
2022-02-23 23:27 PST, Sihui Liu
no flags
Patch (6.56 KB, patch)
2022-02-25 10:34 PST, Sihui Liu
no flags
Patch for landing (6.61 KB, patch)
2022-02-25 19:58 PST, Sihui Liu
no flags
Patch (9.10 KB, patch)
2022-02-27 23:06 PST, Sihui Liu
no flags
Patch for landing (9.28 KB, patch)
2022-02-28 16:45 PST, Sihui Liu
no flags
Radar WebKit Bug Importer
Comment 1 2022-02-22 16:44:35 PST
Sihui Liu
Comment 2 2022-02-23 23:27:59 PST
Sihui Liu
Comment 3 2022-02-25 10:34:32 PST
Alexey Proskuryakov
Comment 4 2022-02-25 16:59:45 PST
Comment on attachment 453229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453229&action=review > Source/WebKit/NetworkProcess/NetworkProcess.cpp:264 > // Make sure we flush all cookies to disk before exiting. This comment should probably be omitted. Typically, we want comments to explain "why", not "what". This comment just explains what, and it's not even entirely accurate any more after this addition. > Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:89 > + std::atexit(commitTransactionsAtExit); Do we still have a boost to prevent suspension at this point?
Sihui Liu
Comment 5 2022-02-25 19:57:55 PST
Comment on attachment 453229 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453229&action=review >> Source/WebKit/NetworkProcess/NetworkProcess.cpp:264 >> // Make sure we flush all cookies to disk before exiting. > > This comment should probably be omitted. Typically, we want comments to explain "why", not "what". This comment just explains what, and it's not even entirely accurate any more after this addition. Sure, will remove. >> Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:89 >> + std::atexit(commitTransactionsAtExit); > > Do we still have a boost to prevent suspension at this point? You mean to prevent process from being suspended by taking an assertion? I am not sure if a process can get suspended when it is exiting, but if it can, the worst case seems to be the process getting killed and losing data in unfinished transactions, which sounds like a rare case.
Sihui Liu
Comment 6 2022-02-25 19:58:49 PST
Created attachment 453284 [details] Patch for landing
EWS
Comment 7 2022-02-25 21:43:55 PST
Committed r290544 (247822@main): <https://commits.webkit.org/247822@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453284 [details].
Sihui Liu
Comment 8 2022-02-27 22:07:30 PST
Reopened as the test failure is not fixed.
Sihui Liu
Comment 9 2022-02-27 23:06:54 PST
Darin Adler
Comment 10 2022-02-28 15:33:35 PST
Comment on attachment 453368 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453368&action=review > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:43 > +#include <wtf/WeakHashSet.h> Should not need this in the header just to declare a function returning a reference to a WeakHashSet. Forward.h should suffice. > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:74 > + static WeakHashSet<NetworkStorageManager>& allNetworkStorageManagers(); I suggest we publish a forEachNetworkStorageManager function for NetworkProcess.cpp to use instead of of publishing a read/write reference to a WeakHashSet; would be nice to keep the WeakHashSet as a hidden implementation detail of this class.
Sihui Liu
Comment 11 2022-02-28 16:42:46 PST
(In reply to Darin Adler from comment #10) > Comment on attachment 453368 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=453368&action=review > > > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:43 > > +#include <wtf/WeakHashSet.h> > > Should not need this in the header just to declare a function returning a > reference to a WeakHashSet. Forward.h should suffice. > > > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:74 > > + static WeakHashSet<NetworkStorageManager>& allNetworkStorageManagers(); > > I suggest we publish a forEachNetworkStorageManager function for > NetworkProcess.cpp to use instead of of publishing a read/write reference to > a WeakHashSet; would be nice to keep the WeakHashSet as a hidden > implementation detail of this class. Sure, will add NetworkStorageManager::forEach() and remove WeakHashSet.h.
Sihui Liu
Comment 12 2022-02-28 16:45:29 PST
Created attachment 453449 [details] Patch for landing
Darin Adler
Comment 13 2022-02-28 17:35:15 PST
Comment on attachment 453449 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=453449&action=review > Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:43 > +#include <wtf/WeakHashSet.h> Please don’t add this include to this header.
EWS
Comment 14 2022-02-28 18:35:47 PST
Committed r290623 (247896@main): <https://commits.webkit.org/247896@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453449 [details].
Sihui Liu
Comment 15 2022-03-01 14:34:28 PST
Comment on attachment 453449 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=453449&action=review >> Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h:43 >> +#include <wtf/WeakHashSet.h> > > Please don’t add this include to this header. Oops, I missed this. Removed in r290669.
Note You need to log in before you can comment on or make changes to this bug.