diff options
author | Juanjo Rodriguez <juanjo@apache.org> | 2020-03-23 00:39:56 +0100 |
---|---|---|
committer | Juanjo Rodriguez <jjrodrig@gmail.com> | 2020-04-07 08:20:40 +0200 |
commit | cf5f963bd5743346a642d6177cc10e3311bb505c (patch) | |
tree | 275867a736774f76384081cde6ff0f1ee392d3a1 | |
parent | c1dd946d83f3f0c2ea0eb58ba82bc3bd909fafa4 (diff) | |
download | couchdb-cf5f963bd5743346a642d6177cc10e3311bb505c.tar.gz |
Improve test initialization
-rw-r--r-- | test/elixir/test/cookie_auth_test.exs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/elixir/test/cookie_auth_test.exs b/test/elixir/test/cookie_auth_test.exs index b10ee84f1..abc0fd767 100644 --- a/test/elixir/test/cookie_auth_test.exs +++ b/test/elixir/test/cookie_auth_test.exs @@ -34,13 +34,14 @@ defmodule CookieAuthTest do # Create db if not exists Couch.put("/#{@users_db}") - resp = - Couch.get( - "/#{@users_db}/_changes", - query: [feed: "longpoll", timeout: 5000, filter: "_design"] - ) - - assert resp.body + retry_until(fn -> + resp = + Couch.get( + "/#{@users_db}/_changes", + query: [feed: "longpoll", timeout: 5000, filter: "_design"] + ) + length(resp.body["results"]) > 0 + end) on_exit(&tear_down/0) |