Skip to content

Commit

Permalink
Fix flaky elixir users_db_tests
Browse files Browse the repository at this point in the history
This fails more often on MacOS CI workers [1] but it seems to be a general
flaky test as the users auth ddoc is not guaranteed to be inserted
synchronously.

[1] #4397 (comment)
  • Loading branch information
nickva committed Mar 4, 2023
1 parent 7ec5f64 commit 6e98345
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/elixir/test/users_db_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ defmodule UsersDbTest do
test "users db", context do
db_name = context[:db_name]
# test that the users db is born with the auth ddoc
ddoc = Couch.get("/#{@users_db_name}/_design/_auth")
assert ddoc.body["validate_doc_update"] != nil
get_ddoc = fn ->
ddoc = Couch.get("/#{@users_db_name}/_design/_auth")
ddoc.body["validate_doc_update"]
end
retry_until(fn -> get_ddoc.() != nil end)
assert get_ddoc.() != nil

jchris_user_doc =
prepare_user_doc([
Expand Down

0 comments on commit 6e98345

Please sign in to comment.