Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.8k stars 601 forks source link

toEventually when used from an async context in the main actor always results in a timeout error. #1006

Closed younata closed 1 year ago

younata commented 2 years ago
@MainActor
func testToEventuallyInAsyncContextOnMain() async {
    expect(1).toEventually(equal(1)) // Fails with 'testToEventuallyInAsyncContextOnMain(): timed out before returning a value'
}

This bug does not occur when you run the test on a different thread, that is the following tests passes:

func testToEventuallyInAsyncContextOffMain() async {
    expect(1).toEventually(equal(1))
    expect { usleep(10); return 1 }.toEventually(equal(1))
}

This is a blocker to releasing v11.