Open doozMen opened 1 month ago
@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:
Would you be open to exploring if this fix would address the problem for you when applied to the main
branch?
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?