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

Bind patches to coroutine instances to avoid concurrency issues #123

Merged
merged 3 commits into from
May 14, 2019

Conversation

Martiusweb
Copy link
Owner

We need to copy the patches of a coroutine so they are not shared between multiple instances of a coroutine.

This led to several problems shown in the added tests and discussed in #121.

This fixes #121. The problem is that if a patched coroutine runs
multiple times concurrently, they used to share the patch object, which
affected the concurrent runs.

It had the side effect of pinning the patch mock to the coroutine
function, hence each call received the same mock.

TODO document the behavior and the quirks.
@Martiusweb Martiusweb merged commit d1d47ec into master May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant