You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/07/28 20:13:46 UTC
[couchdb] branch fix-replication-elixir-test created (now 8a82e41)
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a change to branch fix-replication-elixir-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
at 8a82e41 Use _scheduler/jobs instead of _active_tasks in replication Elixir tests
This branch includes the following new commits:
new 8a82e41 Use _scheduler/jobs instead of _active_tasks in replication Elixir tests
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: Use _scheduler/jobs instead of _active_tasks in
replication Elixir tests
Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch fix-replication-elixir-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 8a82e41956ab4c63fc921ce55baac7e29dd15b03
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Tue Jul 28 16:10:05 2020 -0400
Use _scheduler/jobs instead of _active_tasks in replication Elixir tests
After _active_tasks was implemented on FDB, single-node (previous)
_active_tasks implementation, had stopped working. It turns out were were
relying on it to run Elixir replication tests.
To not lose test coverage, and before we implement replicator on FDB, switch
the tests to use `_scheduler/jobs`.
---
test/elixir/test/replication_test.exs | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/test/elixir/test/replication_test.exs b/test/elixir/test/replication_test.exs
index 78f3660..1980543 100644
--- a/test/elixir/test/replication_test.exs
+++ b/test/elixir/test/replication_test.exs
@@ -127,7 +127,7 @@ defmodule ReplicationTest do
task = get_task(repl_id, 3_000)
assert is_map(task)
- assert task["replication_id"] == repl_id
+ assert task["id"] == repl_id
repl_body = %{
"replication_id" => repl_id,
@@ -1749,8 +1749,13 @@ defmodule ReplicationTest do
def wait_for_repl(src_db_name, repl_id, expect_revs_checked, wait_left) do
task = get_task(repl_id, 0)
- through_seq = task["through_seq"] || "0"
- revs_checked = task["revisions_checked"]
+ info = if task["info"] == :null do
+ info = %{"through_seq" => "0", "revisions_checked" => "0"}
+ else
+ task["info"]
+ end
+ through_seq = info["through_seq"] || "0"
+ revs_checked = info["revisions_checked"] || "0"
changes = get_db_changes(src_db_name, %{:since => through_seq})
if length(changes["results"]) > 0 or revs_checked < expect_revs_checked do
@@ -1799,13 +1804,14 @@ defmodule ReplicationTest do
end
def try_get_task(repl_id) do
- resp = Couch.get("/_active_tasks")
- assert HTTPotion.Response.success?(resp)
- assert is_list(resp.body)
+ resp = Couch.get("/_scheduler/jobs/#{repl_id}")
- Enum.find(resp.body, nil, fn task ->
- task["replication_id"] == repl_id
- end)
+ if HTTPotion.Response.success?(resp) do
+ assert is_map(resp.body)
+ resp.body
+ else
+ nil
+ end
end
def set_user(uri, userinfo) do