Skip to content

Fix possible concurrent mutation crash #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025
Merged

Conversation

ileitch
Copy link
Contributor

@ileitch ileitch commented Apr 26, 2025

No description provided.

@ileitch ileitch force-pushed the fix-config-matcher-crash branch from 84ad6a6 to 1d83385 Compare April 26, 2025 11:58
@ileitch ileitch force-pushed the fix-config-matcher-crash branch from 1d83385 to 3cccff8 Compare April 26, 2025 12:01
@ileitch ileitch requested a review from Copilot April 26, 2025 12:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {

@ileitch ileitch merged commit 63e52c1 into master Apr 26, 2025
9 checks passed
@ileitch ileitch deleted the fix-config-matcher-crash branch April 26, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant