You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2017/05/20 12:10:12 UTC
[couchdb] branch master updated: better test as per @nickva
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/master by this push:
new aca6a45 better test as per @nickva
aca6a45 is described below
commit aca6a459e454aa684cb864901899a3320a0c2480
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sat May 20 13:31:27 2017 +0200
better test as per @nickva
---
.../test/couch_replicator_compact_tests.erl | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/couch_replicator/test/couch_replicator_compact_tests.erl b/src/couch_replicator/test/couch_replicator_compact_tests.erl
index a1b38a8..c99335d 100644
--- a/src/couch_replicator/test/couch_replicator_compact_tests.erl
+++ b/src/couch_replicator/test/couch_replicator_compact_tests.erl
@@ -113,7 +113,9 @@ 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] = replication_tasks(),
+ RepTasks = wait_for_task_status(),
+ ?assertNotEqual(timeout, RepTasks),
+ [RepTask] = RepTasks,
?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)),
@@ -144,6 +146,16 @@ wait_for_replicator(RepId) ->
?assertMatch({ok, _}, rep_details(RepId)),
ok.
+wait_for_task_status() ->
+ test_util:wait(fun() ->
+ case couch_task_status:all() of
+ [] ->
+ wait;
+ Tasks ->
+ Tasks
+ end
+ end).
+
should_cancel_replication(RepId, RepPid) ->
?_assertNot(begin
ok = couch_replicator_scheduler:remove_job(RepId),
--
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].