[Site Isolation] WebKitTestRunner leaks isolated site records between tests and across runs - #71663
Open
szewai wants to merge 1 commit into
Conversation
… tests and across runs https://bugs.webkit.org/show_bug.cgi?id=321817 rdar://184954498 Reviewed by NOBODY (OOPS!). configureWebsiteDataStoreTemporaryDirectories() redirects every website data directory WebKitTestRunner uses into its temporary folder, but isolatedSitesDirectory was missing from that list, so it resolved to the real per-bundle path and isolated site records are shared across runs. Records also survived between tests within a run, since resetStateToConsistentValues() had nothing that cleared them. Fixing these by redirecting the directory, and adding WebsiteDataType::IsolatedSiteRecord to the set WKWebsiteDataStoreClearStorage() removes. Removal routes through IsolatedSiteStore::removeAllSites(), which removes site records but does not clear import-from-ITP flag, so a reset does not cause a re-import. testRunner.clearStorage() now clears these records too, which is what a test asking for a clean slate wants, and nothing depends on them surviving it. Drive by: give SiteIsolationSharedProcessEnabled defaultsOverridable: true and change its status from unstable to internal, so it can be toggled through NSUserDefaults without a build change while it is being brought up. No user-visible impact - the default value is unchanged, and GeneratePreferences.rb treats the two statuses identically. No new tests: this is test infrastructure, and IsolatedSiteStore's persistence and removal behavior is already covered by the TestWebKitAPI IsolatedSiteStore tests. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationCopyIsolatedSitesDirectory): (WKWebsiteDataStoreConfigurationSetIsolatedSitesDirectory): * Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreClearStorage): * Tools/WebKitTestRunner/TestController.cpp: (WTR::TestController::configureWebsiteDataStoreTemporaryDirectories):
Collaborator
|
EWS run on current version of this PR (hash e59288a) Details |
rniwa
reviewed
Aug 15, 2026
| @@ -1026,6 +1026,7 @@ void TestController::configureWebsiteDataStoreTemporaryDirectories(WKWebsiteData | |||
| WKWebsiteDataStoreConfigurationSetMediaKeysStorageDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "MediaKeys"_s, pathSeparator, randomNumber)).get()); | |||
| WKWebsiteDataStoreConfigurationSetResourceLoadStatisticsDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "ResourceLoadStatistics"_s, pathSeparator, randomNumber)).get()); | |||
| WKWebsiteDataStoreConfigurationSetServiceWorkerRegistrationDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "ServiceWorkers"_s, pathSeparator, randomNumber)).get()); | |||
| WKWebsiteDataStoreConfigurationSetIsolatedSitesDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "IsolatedSites"_s, pathSeparator, randomNumber)).get()); | |||
Member
There was a problem hiding this comment.
Don't we want to delete this file afterwards?
rniwa
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
e59288a
e59288a