Skip to content

Commit

Permalink
Fix docs in Snap.Test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtaylor committed Nov 12, 2023
1 parent 6620516 commit e29947c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/snap/test.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
defmodule Snap.Test do
@moduledoc """
Helpers around testing with `Snap`.
Unlike SQL databases, ElasticSearch/OpenSearch does not provide transaction
isolation, which is how `Ecto.Adapters.SQL.Sandbox` isolates test
processes, allowing multiple tests to run asynchronously.
Expand All @@ -19,11 +21,11 @@ defmodule Snap.Test do
if context[:snap] do
namespace = Snap.Test.generate_namespace_for_pid(self())
Snap.Cluster.Namespace.set_process_namespace(Cluster, namespace)
Snap.Test.clear_indexes(Cluster)
Snap.Test.drop_indexes(Cluster)
on_exit(fn ->
Snap.Cluster.Namespace.set_process_namespace(Cluster, namespace)
Snap.Test.clear_indexes(Cluster)
Snap.Test.drop_indexes(Cluster)
end)
end
end
Expand Down

0 comments on commit e29947c

Please # to comment.