diff options
author | Juanjo Rodriguez <juanjo@apache.org> | 2020-03-23 00:39:56 +0100 |
---|---|---|
committer | Juanjo Rodriguez <jjrodrig@gmail.com> | 2020-04-04 21:57:20 +0200 |
commit | 37ac556b33281f36bd56a61b3d45898d034b0515 (patch) | |
tree | c05a64e735c2652526ceacf7edbdb55d1f683e86 | |
parent | c80b71f7de7f301480641c48dabce06e5c31d4e6 (diff) | |
download | couchdb-37ac556b33281f36bd56a61b3d45898d034b0515.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) |