Skip to content

Make it possible to have a test wait for other thread to consume a mock #139

@jordfras

Description

@jordfras

Sometimes the code you are unit testing is threaded. It is useful to have a mechanism to wait for mocks to be consumed to avoid having to do white-box testing where you alter your production code to know when something is completed by the thread.

I suggest adding a function called wait_for_consumption() which takes a Duration as a timeout. It should block until expectations have been consumed or panic if the timeout is reached.

I made a pull request for this: #138

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions