Within our production codebase, I can reproduce with this simple class:
public final class MyController {
public let progress: Progress
init() {
progress = Progress()
progress.cancellationHandler = {}
}
}
And this simple test:
import Testing
@Test
func reproDispatchAssertQueueFail() async throws {
let dc = MyController()
dc.progress.cancel()
}
In this case, MyController is defined in a Package, which the test imports. I cannot reproduce this when MyController is defined in the same file as the test.
Pulling that same code into a brand new sample project, I cannot reproduce this.
Also, I do not see this issue when testing against iOS 17.5, I'm only seeing it on iOS 18 simulators.
Also, it readily reproduces after running the test immediately after a clean and rebuild of the package defining MyController.