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
You will see it crashes. The docs state that Thread.isMainThread is not available. Weirdly it is on macOS just not on linux.
To Reproduce
run the test project on linux and maybe add code
#expect(Thread.isMainThread == true)
This will work on mac and not on linux
Expected behavior
Not creating deadlock because of doing dispach on main in sync from main
Screenshots
Environment
swift-snapshot-testing version [1.17..5]
Swift [6.0.1]
OS: aarch64-unknown-linux-gnu
Additional context
Maybe also a bug in swift but not sure as when you the check is unavailable in async context according to the docs. So you should not rely on it?
Maybe have a asser option that is marked with @mainactor might be better?
The text was updated successfully, but these errors were encountered:
@doozMen Thanks for the report. We're running SnapshotTesting on Linux for pointfree.co, but are on a particular branch that uses this logic to dispatch to the main queue instead:
Describe the bug
Only happens on linux
You will see it crashes. The docs state that
Thread.isMainThread
is not available. Weirdly it is on macOS just not on linux.To Reproduce
run the test project on linux and maybe add code
This will work on mac and not on linux
Expected behavior
Not creating deadlock because of doing dispach on main in sync from main
Screenshots
Environment
Additional context
Maybe also a bug in swift but not sure as when you the check is unavailable in async context according to the docs. So you should not rely on it?
Maybe have a asser option that is marked with @mainactor might be better?
The text was updated successfully, but these errors were encountered: