Skip to content

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

@younata

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions