Fix possible concurrent mutation crash#925
Merged
Merged
Conversation
84ad6a6 to
1d83385
Compare
1d83385 to
3cccff8
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a potential concurrent mutation crash by refactoring how Configuration is handled within the test suite. Key changes include:
- Adding a configuration parameter to build and index methods in various test cases.
- Refactoring the Configuration type by removing the reset methods and replacing manual matcher resets with lazy property initializers.
- Updating dependencies and test code to align with the new Configuration usage.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/XcodeTests/XcodeSourceGraphTestCase.swift | Updated build method signature to pass a Configuration instance. |
| Tests/XcodeTests/UIKitProjectTest.swift and SwiftUIProjectTest.swift | Updated build and index calls to include an explicit Configuration. |
| Tests/Shared/SourceGraphTestCase.swift | Modified index method overloads to accept a configuration parameter. |
| Tests/Shared/FixtureSourceGraphTestCase.swift | Updated analyze invocations to pass configuration arguments. |
| Tests/SPMTests/SPMProjectTest.swift and CrossModuleRetentionTest.swift | Updated indexing calls with new configuration parameter. |
| Tests/AccessibilityTests/RedundantPublicAccessibilityTest.swift | Updated calls from static Self.index() to instance index() methods. |
| Sources/Configuration/Configuration.swift | Removed the reset methods and matcher cache; replaced with lazy properties. |
| Package.swift | Added a dependency on the Configuration target. |
| CHANGELOG.md | Added a changelog entry for the concurrent mutation crash fix. |
Files not reviewed (1)
- baselines/linux.json: Language not supported
Comments suppressed due to low confidence (1)
Tests/Shared/SourceGraphTestCase.swift:40
- [nitpick] The overloading of the 'index' method as both a static and instance method with similar signatures might be confusing. Consider consolidating to a single consistent interface to improve clarity when invoking indexing in tests.
func index(sourceFiles: [FilePath]? = nil, configuration: Configuration = .init()) {
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.
No description provided.