summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@gmail.com>2022-07-08 14:15:08 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2022-07-08 15:01:00 -0400
commiteb0b28a7067b330c439fd2253c1b54f04d848b90 (patch)
tree776cead52fe4e9434a68255ef02730435faabc2e
parent6a455c74bd6426847698b7543322907be64b2ac0 (diff)
downloadcouchdb-eb0b28a7067b330c439fd2253c1b54f04d848b90.tar.gz
Fix flaky "validate doc update" elixir test
We saw it fail quite a few times already so adding a retry around it. Unfortunately it could now fail with a timeout instead of an assert but since we're updating a document there is no idempotent way to testing it (retry until, then do the actual assert again below).
-rw-r--r--test/elixir/test/design_docs_test.exs13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/elixir/test/design_docs_test.exs b/test/elixir/test/design_docs_test.exs
index 58058b0c4..7a6d875c5 100644
--- a/test/elixir/test/design_docs_test.exs
+++ b/test/elixir/test/design_docs_test.exs
@@ -476,12 +476,13 @@ defmodule DesignDocsTest do
ddoc_resp.body
|> Map.put("_deleted", true)
- del_resp =
- Couch.post("/#{db_name}",
- body: ddoc
- )
-
- assert del_resp.status_code in [201, 202]
+ retry_until(fn ->
+ retry_resp =
+ Couch.post("/#{db_name}",
+ body: ddoc
+ )
+ retry_resp.status_code in [201, 202]
+ end)
{:ok, _} = create_doc(db_name, %{_id: "doc1", value: 4})
end