diff --git a/VERSION b/VERSION index 6d4b6e1b..439ba987 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.55 +1.1.56 diff --git a/test/integration/proxy_test.exs b/test/integration/proxy_test.exs index 85c7a758..689912f8 100644 --- a/test/integration/proxy_test.exs +++ b/test/integration/proxy_test.exs @@ -1,6 +1,8 @@ defmodule Supavisor.Integration.ProxyTest do - require Logger use Supavisor.DataCase, async: true + + require Logger + alias Postgrex, as: P @tenant "proxy_tenant1" @@ -227,7 +229,7 @@ defmodule Supavisor.Integration.ProxyTest do first_pass = conn.("postgres") new_pass = conn.("postgres_new") - {:ok, pid} = parse_uri(first_pass) |> single_connection() + assert {:ok, pid} = parse_uri(first_pass) |> single_connection() assert [%Postgrex.Result{rows: [["1"]]}] = P.SimpleConnection.call(pid, {:query, "select 1;"}) diff --git a/test/supavisor/prom_ex_test.exs b/test/supavisor/prom_ex_test.exs index 83f90051..8bea1742 100644 --- a/test/supavisor/prom_ex_test.exs +++ b/test/supavisor/prom_ex_test.exs @@ -1,9 +1,8 @@ defmodule Supavisor.PromExTest do use ExUnit.Case, async: true - require Logger - alias Supavisor.Monitoring.PromEx use Supavisor.DataCase - alias Postgrex, as: P + + alias Supavisor.Monitoring.PromEx @tenant "prom_tenant" @@ -17,21 +16,23 @@ defmodule Supavisor.PromExTest do database: db_conf[:database], password: db_conf[:password], username: db_conf[:username] <> "." <> @tenant, - socket_dir: nil + socket_dir: nil, + show_sensitive_data_on_connection_error: true ) + assert :idle == DBConnection.status(proxy) + %{proxy: proxy, user: db_conf[:username], db_name: db_conf[:database]} end test "remove tenant tag upon termination", %{proxy: proxy, user: user, db_name: db_name} do - P.query!(proxy, "select 1;", []) - Process.sleep(500) - metrics = PromEx.get_metrics() - assert metrics =~ "tenant=\"#{@tenant}\"" + assert PromEx.get_metrics() =~ "tenant=\"#{@tenant}\"" + GenServer.stop(proxy) - Process.sleep(500) Supavisor.stop({{:single, @tenant}, user, :transaction, db_name}) + Process.sleep(500) + refute PromEx.get_metrics() =~ "tenant=\"#{@tenant}\"" end end