ably / ably-asset-tracking-swift

iOS client SDKs for the Ably Asset Tracking service.
Apache License 2.0
9 stars 6 forks source link

Don’t use Sourcery log handler mock where concurrent access is possible #615

Closed lawrence-forooghian closed 1 year ago

lawrence-forooghian commented 1 year ago

We seem to have had an increased number of crashes in the test suite recently, e.g. this one. I briefly investigated these and I think it’s due to concurrent access of mutable shared state in InternalLogHandlerMock.

So, don’t use the Sourcery mock in these situations, and document why.

I suspect that I introduced these crashes in 0e8515c, which adds logging to the Callback struct. Its messages are logged from multiple threads.