You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit changes the approach to detect if a snapshot is generated on the main thread. However, as discussed in GRDBSnapshotTests issue, this is a breaking change for certain code patterns.
// Crash
func test_issue_5() throws {
let dbQueue = try DatabaseQueue()
try dbQueue.read { db in
assertSnapshot(of: "SELECT 'Hello, world!'", as: .dump(db))
}
}
Or:
// On the main thread
letqueue=DispatchQueue(label:"test")
queue.sync{print("Hello")
// Success: we're on the main thread
assert(Thread.isMainThread)
// assertSnapshot ...
}
Expected behavior
A snapshot is successfully recorded and generated
Environment
swift-snapshot-testing version 1.18.0 and higher
Xcode 16.2
Swift 6
OS: iOS 18
The text was updated successfully, but these errors were encountered:
Unfortunately #946 introduced a deadlock when `assertSnapshot` is called
on the main thread but not the main queue, so let's revert to the old
code path for now with an explicit `Test.current` check to avoid the
original issue.
Fixes#961.
Describe the bug
This commit changes the approach to detect if a snapshot is generated on the main thread. However, as discussed in GRDBSnapshotTests issue, this is a breaking change for certain code patterns.
To Reproduce
Download GRDBSnapshotTesting and add the following test case:
Or:
Expected behavior
A snapshot is successfully recorded and generated
Environment
The text was updated successfully, but these errors were encountered: