From f0bdf872b57e7b9734372587eb9cfe8430ea15e1 Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Mon, 19 Jun 2023 10:32:34 +0100 Subject: [PATCH] Add eventually/1 call to flaky test (#3054) --- test/workers/import_google_analytics_test.exs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/workers/import_google_analytics_test.exs b/test/workers/import_google_analytics_test.exs index 90185ffa7..c7440c978 100644 --- a/test/workers/import_google_analytics_test.exs +++ b/test/workers/import_google_analytics_test.exs @@ -158,7 +158,10 @@ defmodule Plausible.Workers.ImportGoogleAnalyticsTest do api_stub ) - assert Plausible.Stats.Clickhouse.imported_pageview_count(site) == 0 + assert eventually(fn -> + count = Plausible.Stats.Clickhouse.imported_pageview_count(site) + {count == 0, count} + end) end test "sends email to owner after failed import" do