Description
SyncEngineDelegateTests.accountChanged injects its delegate through a test trait:
@Test($syncEngineDelegate.set(MyDelegate()))
func accountChanged() async throws { … }
Trait values seem to be constructed during test planning, so the MyDelegate instance is created for every run, including runs where accountChanged is not included. In those runs the instance is discarded during planning, its deinit finds wasCalled == false, and records an issue outside of any running test:
deinit {
guard wasCalled.withValue(\.self)
else {
Issue.record("Delegate method 'syncEngine(_:accountChanged:)' was not called.")
return
}
}
Consequences
In Xcode 27 (beta 3 and beta 4), running any individual test or suite from this package crashes the test runner, while the full suite runs fine. It seems that the crash happens when Xcode processes the issue recorded outside of a test, though it's unclear whether it's meant to handle that at all. Under swift test it seems to work fine.
The issue was initially observed while working on #508, although it’s unrelated.
Reproduction
On main, with Xcode 27 beta 3 or 4:
xcodebuild test -scheme sqlite-data-Package -destination 'platform=macOS' \
-only-testing:SQLiteDataTests/UserlandTests
fails with Exceeded max restart count of 2. (Underlying Error: Crash: xctest at ABI.EncodedEvent.encode(to:)).
Disclaimer: AI assistance (Claude Code with Fable model) was used to investigate this issue and prepare this report.
Checklist
SQLiteData version information
00c5458
Xcode version information
Xcode 27 beta 3 & 4
Swift Compiler version information
swift-driver version: 1.168.5 Apple Swift version 6.4 (swiftlang-6.4.0.27.1 clang-2100.3.27.1)
Target: arm64-apple-macosx27.0.0
Description
SyncEngineDelegateTests.accountChangedinjects its delegate through a test trait:Trait values seem to be constructed during test planning, so the
MyDelegateinstance is created for every run, including runs whereaccountChangedis not included. In those runs the instance is discarded during planning, itsdeinitfindswasCalled == false, and records an issue outside of any running test:Consequences
In Xcode 27 (beta 3 and beta 4), running any individual test or suite from this package crashes the test runner, while the full suite runs fine. It seems that the crash happens when Xcode processes the issue recorded outside of a test, though it's unclear whether it's meant to handle that at all. Under
swift testit seems to work fine.The issue was initially observed while working on #508, although it’s unrelated.
Reproduction
On
main, with Xcode 27 beta 3 or 4:fails with
Exceeded max restart count of 2. (Underlying Error: Crash: xctest at ABI.EncodedEvent.encode(to:)).Disclaimer: AI assistance (Claude Code with Fable model) was used to investigate this issue and prepare this report.
Checklist
mainbranch of this package.SQLiteData version information
00c5458
Xcode version information
Xcode 27 beta 3 & 4
Swift Compiler version information