Repository navigation
Conversation
…nces TriggerConfigStore, AliasStore and QuickAccessStore tests each opened a uniquely-named UserDefaults suite per test and never removed it, so every run added plists to ~/Library/Preferences (~5,800 had piled up locally). Deleting a named suite isn't reliable: cfprefsd rewrites an empty plist even after removePersistentDomain + removing the file. ScratchDefaults instead opens suites by absolute path in a private temp directory and tears them down on deinit; each suite holds one as a stored property so cleanup runs per test. Refs: W-1030
Refs: W-1030
This branch has not been deployed
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.
Summary
TriggerConfigStoreTests,AliasStoreTestsandQuickAccessStoreTestsopened a uniquely-namedUserDefaults(suiteName: "mojito.tests.…")per test and never removed it, so every test run left a plist in~/Library/Preferences. About 5,800 had piled up locally.Removing a named suite isn't reliable either: cfprefsd rewrites an empty plist about a minute later, even after
removePersistentDomainand deleting the file. The newScratchDefaultstest helper opens suites by absolute path inside a private temp directory. On deinit it clears each domain and deletes the directory. Each suite keeps one as a stored property, and Swift Testing creates a fresh suite instance per test, so cleanup runs after every test.Tests/MojitoTests/ScratchDefaults.swift: the helper, plus a regression test.ScratchDefaults.CLAUDE.md: note under "Things that have bitten us" so new store tests use the helper.Test plan
scripts/run-tests.sh: 321/321 pass~/Library/Preferenceshas nomojito.tests.*plists and$TMPDIRhas nomojito-tests-*foldersRefs W-1030