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/25 19:05:34 UTC

[couchdb] branch master updated: fixes to elixir tests (#1939)

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

garren 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 b81ca74  fixes to elixir tests (#1939)
b81ca74 is described below

commit b81ca74e86d89189edbd05c837ba072c15aefd0a
Author: garren smith <ga...@gmail.com>
AuthorDate: Mon Feb 25 21:05:30 2019 +0200

    fixes to elixir tests (#1939)
---
 test/elixir/lib/couch/db_test.ex         | 10 ++++++----
 test/elixir/test/partition_size_test.exs |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/test/elixir/lib/couch/db_test.ex b/test/elixir/lib/couch/db_test.ex
index f835b0a..7a08aae 100644
--- a/test/elixir/lib/couch/db_test.ex
+++ b/test/elixir/lib/couch/db_test.ex
@@ -161,10 +161,12 @@ defmodule Couch.DBTest do
   end
 
   def create_db(db_name, opts \\ []) do
-    resp = Couch.put("/#{db_name}", opts)
-    assert resp.status_code in [201, 202]
-    assert resp.body == %{"ok" => true}
-    {:ok, resp}
+    retry_until(fn ->
+      resp = Couch.put("/#{db_name}", opts)
+      assert resp.status_code in [201, 202]
+      assert resp.body == %{"ok" => true}
+      {:ok, resp}
+    end)
   end
 
   def delete_db(db_name) do
diff --git a/test/elixir/test/partition_size_test.exs b/test/elixir/test/partition_size_test.exs
index 68759ad..b292dc4 100644
--- a/test/elixir/test/partition_size_test.exs
+++ b/test/elixir/test/partition_size_test.exs
@@ -50,8 +50,11 @@ defmodule PartitionSizeTest do
       end
 
     body = %{:w => 3, :docs => docs}
-    resp = Couch.post("/#{db_name}/_bulk_docs", body: body)
-    assert resp.status_code == 201
+
+    retry_until(fn ->
+      resp = Couch.post("/#{db_name}/_bulk_docs", body: body)
+      assert resp.status_code == 201
+    end)
   end
 
   def save_doc(db_name, doc) do