diff options
author | iilyak <iilyak@ca.ibm.com> | 2017-05-19 08:34:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-19 08:34:58 -0700 |
commit | 6a54abe600d9025f84b3bcaa9b5a9e87a9def321 (patch) | |
tree | 1d9670a79e827f0c6739e3130c0d3088bc2a41aa | |
parent | fb6faec9b91b6593c3c10e35728a2f9cfc623a43 (diff) | |
parent | 27f5067c853f9cb8d124328e7844b27d04630d94 (diff) | |
download | couchdb-6a54abe600d9025f84b3bcaa9b5a9e87a9def321.tar.gz |
Merge pull request #532 from cloudant/filter_out_non_replicator_tasks
Filter out non replicator tasks in test case
-rw-r--r-- | src/couch_replicator/test/couch_replicator_compact_tests.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/couch_replicator/test/couch_replicator_compact_tests.erl b/src/couch_replicator/test/couch_replicator_compact_tests.erl index d243b1c09..a1b38a889 100644 --- a/src/couch_replicator/test/couch_replicator_compact_tests.erl +++ b/src/couch_replicator/test/couch_replicator_compact_tests.erl @@ -113,7 +113,7 @@ check_active_tasks(RepPid, {BaseId, Ext} = RepId, Src, Tgt) -> FullRepId = ?l2b(BaseId ++ Ext), Pid = ?l2b(pid_to_list(RepPid)), ok = wait_for_replicator(RepId), - [RepTask] = couch_task_status:all(), + [RepTask] = replication_tasks(), ?assertEqual(Pid, couch_util:get_value(pid, RepTask)), ?assertEqual(FullRepId, couch_util:get_value(replication_id, RepTask)), ?assertEqual(true, couch_util:get_value(continuous, RepTask)), @@ -129,10 +129,14 @@ check_active_tasks(RepPid, {BaseId, Ext} = RepId, Src, Tgt) -> Pending = couch_util:get_value(changes_pending, RepTask), ?assert(is_integer(Pending)). - rep_details(RepId) -> gen_server:call(get_pid(RepId), get_details). +replication_tasks() -> + lists:filter(fun(P) -> + couch_util:get_value(type, P) =:= replication + end, couch_task_status:all()). + wait_for_replicator(RepId) -> %% since replicator started asynchronously %% we need to wait when it would be in couch_task_status |