You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2019/02/21 12:13:26 UTC

[couchdb] branch jenkins-fix-elixir-take-3 updated: more tests failing and fixed

This is an automated email from the ASF dual-hosted git repository.

garren pushed a commit to branch jenkins-fix-elixir-take-3
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/jenkins-fix-elixir-take-3 by this push:
     new 33a4ef2  more tests failing and fixed
33a4ef2 is described below

commit 33a4ef2871ee5934e8a27b76504a1adebba4f1af
Author: Garren Smith <ga...@gmail.com>
AuthorDate: Thu Feb 21 14:13:09 2019 +0200

    more tests failing and fixed
---
 test/elixir/test/security_validation_test.exs | 10 ++++++----
 test/elixir/test/view_collation_test.exs      | 10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/test/elixir/test/security_validation_test.exs b/test/elixir/test/security_validation_test.exs
index 56c4ec3..0df3a78 100644
--- a/test/elixir/test/security_validation_test.exs
+++ b/test/elixir/test/security_validation_test.exs
@@ -159,10 +159,12 @@ defmodule SecurityValidationTest do
     assert Couch.put("/#{db_name}/_security", body: sec_obj).body["ok"]
     assert Couch.post("/#{db_name}", body: @ddoc).body["ok"]
 
-    resp = Couch.put("/#{db_name}/test_doc", body: %{foo: 1}, headers: jerry)
-    assert resp.status_code == 403
-    assert resp.body["error"] == "forbidden"
-    assert resp.body["reason"] == "Documents must have an author field"
+    retry_until(fn ->
+      resp = Couch.put("/#{db_name}/test_doc", body: %{foo: 1}, headers: jerry)
+      assert resp.status_code == 403
+      assert resp.body["error"] == "forbidden"
+      assert resp.body["reason"] == "Documents must have an author field"
+    end)
 
     # Jerry can write the document
     assert Couch.put(
diff --git a/test/elixir/test/view_collation_test.exs b/test/elixir/test/view_collation_test.exs
index 6f9c3be..7563ba4 100644
--- a/test/elixir/test/view_collation_test.exs
+++ b/test/elixir/test/view_collation_test.exs
@@ -81,11 +81,13 @@ defmodule ViewCollationTest do
   end
 
   test "descending collation order", context do
-    resp = Couch.get(url(context), query: %{"descending" => "true"})
-    pairs = Enum.zip(resp.body["rows"], Enum.reverse(@values))
+    retry_until(fn ->
+      resp = Couch.get(url(context), query: %{"descending" => "true"})
+      pairs = Enum.zip(resp.body["rows"], Enum.reverse(@values))
 
-    Enum.each(pairs, fn {row, value} ->
-      assert row["key"] == convert(value)
+      Enum.each(pairs, fn {row, value} ->
+        assert row["key"] == convert(value)
+      end)
     end)
   end