Skip to content

Commit

Permalink
(chore): Fix sporadically failing test due to capture_log (#2258)
Browse files Browse the repository at this point in the history
This PR fixes the sporadic test that can be seen failing here:

https://github.com/electric-sql/electric/actions/runs/12934429277/job/36075427601

I've also added the cause to slab so that we can hopefully prevent this
kind of issue in the future:

https://electric-sql.slab.com/posts/sporadically-failing-elixir-tests-pfyia5on?shr=vrDh-k20QJMXaygzaPfMu4J4
  • Loading branch information
robacourt authored Jan 28, 2025
1 parent 3be06ec commit a09a7a7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ defmodule Electric.Postgres.ConfigurationTest do
pg_version,
publication
)
end) =~ "Altering identity"
end) =~ ~r"#{:erlang.pid_to_list(self())}.*Altering identity"

assert get_table_identity(conn, {"public", "items"}) == "f"

Expand All @@ -112,7 +112,10 @@ defmodule Electric.Postgres.ConfigurationTest do
pg_version,
publication
)
end) =~ "Altering identity"
end) =~ ~r"#{:erlang.pid_to_list(self())}.*Altering identity"

# Above we include the pid in the regex to ensure that the log message is from this test's process
# otherwise this test can sporadically fail when run concurrently with other tests that log that message
end

test "works with multiple tables", %{
Expand Down

0 comments on commit a09a7a7

Please sign in to comment.