Fix sync delegate test crash in Xcode 27 beta.#511
Conversation
|
@mbrandonw Thanks for looking into it. I’ve tested it with Xcode 27 β4 and ef3cc19. Unfortunately, I’m still running into the crash when executing individual, unrelated tests. The |
|
Hi @lukaskubanek, thanks for checking. I was playing with two different fixes at once (the one in this PR, and then pointfreeco/swift-concurrency-extras#74) and maybe due to cached artifacts or pure luck it seemed like only the changes in this PR were necessary. But I think the changes in ConcurrencyExtras is the real fix. Wanna point to that branch locally to see if it fixes for you? (Edit: I just merged the PR so point to If so, then I think we will close out this PR and just have people point to the newest ConcurrencyExtras if they need to run tests locally. |
|
@mbrandonw I pointed swift-concurrency-extras to By the way, using |
Fixes #509.
Something different (I think!) in Xcode 27 causes traits to be evaluated on tests that are not actually run. That, coupled with
SyncEngineDelegates being kept in memory for too long, caused a crash when running any tests that did not use the sync delegate trait. The fix is just to weakly hold onto the delegate in theSyncEngine.That does mean that if anyone ever created a sync engine like this:
…will have their delegate immediately deallocated, which would be a bug. Luckily all of our docs and sample apps show off holding on the delegate explicitly, which is standard practice in most Apple APIs.