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 2022/07/08 18:26:51 UTC
[couchdb] 01/01: Fix flaky "validate doc update" elixir test
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch fix-flaky-ddoc-elixir-test
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 1b1ca79207cfcc85b1d83df9a9e0116f449f8c44
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Fri Jul 8 14:15:08 2022 -0400
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).
---
test/elixir/test/design_docs_test.exs | 13 +++++++------
1 file 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