You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ii...@apache.org on 2016/05/24 23:15:00 UTC
[1/2] fabric commit: updated refs/heads/master to 2eb1e13
Repository: couchdb-fabric
Updated Branches:
refs/heads/master 475b90ccd -> 2eb1e132e
Use meck:wait to fix race condition
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.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/19e9959a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/19e9959a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/19e9959a
Branch: refs/heads/master
Commit: 19e9959aab87c8050d280f5d255d58cf1a995614
Parents: 475b90c
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Tue May 24 15:52:25 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Tue May 24 15:52:25 2016 -0700
----------------------------------------------------------------------
src/fabric_doc_open_revs.erl | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/19e9959a/src/fabric_doc_open_revs.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_open_revs.erl b/src/fabric_doc_open_revs.erl
index 4f0bf89..3534830 100644
--- a/src/fabric_doc_open_revs.erl
+++ b/src/fabric_doc_open_revs.erl
@@ -330,7 +330,9 @@ check_finish_quorum_newer() ->
S0 = state0(all, false),
{ok, S1} = handle_message({ok, [foo1(), bar1()]}, w1, S0),
Expect = {stop, [bar1(), foo2()]},
+ ok = meck:reset(fabric),
?assertEqual(Expect, handle_message({ok, [foo2(), bar1()]}, w2, S1)),
+ ok = meck:wait(fabric, update_docs, '_', 5000),
?assertMatch(
[{_, {fabric, update_docs, [_, _, _]}, _}],
meck:history(fabric)
[2/2] fabric commit: updated refs/heads/master to 2eb1e13
Posted by ii...@apache.org.
Merge remote branch 'cloudant:use_meck_wait'
This closes #52
Signed-off-by: ILYA Khlopotov <ii...@ca.ibm.com>
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/2eb1e132
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/2eb1e132
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/2eb1e132
Branch: refs/heads/master
Commit: 2eb1e132e01928a681782c788920c85ce24bfe06
Parents: 475b90c 19e9959
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Tue May 24 16:14:47 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Tue May 24 16:14:47 2016 -0700
----------------------------------------------------------------------
src/fabric_doc_open_revs.erl | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------