Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
younata opened this issue Oct 24, 2022 · 0 comments · Fixed by #1007
Labels
Milestone

Comments

@younata
Copy link
Member

younata commented Oct 24, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant