Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Use meck:wait to fix race condition #52

Merged
merged 1 commit into from
May 24, 2016
Merged

Conversation

iilyak
Copy link
Contributor

@iilyak iilyak commented May 24, 2016

fabric:update_docs is running in the context of a read_repair which is an
independent process started using erlang:spawn/1. This leads to a race
when we try to use meck:history(fabric). Use of meck:wait ensures that
we call meck:history after fabric:update_docs has been called.

fabric:update_docs is running in the context of a `read_repair` which is an
independent process started using `erlang:spawn/1`. This leads to a race
when we try to use `meck:history(fabric)`. Use of `meck:wait` ensures that
we call `meck:history` after `fabric:update_docs` has been called.
@nickva
Copy link
Contributor

nickva commented May 24, 2016

+1

Nice. Didn't know about meck:wait. Could probably use it in other places where we have sleeps and race conditions.

@asfgit asfgit merged commit 19e9959 into apache:master May 24, 2016
asfgit pushed a commit that referenced this pull request May 24, 2016
This closes #52

Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
@iilyak iilyak deleted the use_meck_wait branch May 24, 2016 23:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants