chore: use cleanup function

This commit is contained in:
Manuel de la Peña
2024-12-12 12:12:56 +01:00
parent b074e83e98
commit cac4fd5e8d
7 changed files with 13 additions and 35 deletions

View File

@@ -42,12 +42,8 @@ func newTestStore(t testing.TB) (*Storage, error) {
wait.ForLog("database system is ready to accept connections").WithOccurrence(2),
),
)
testcontainers.CleanupContainer(t, c)
require.NoError(t, err)
t.Cleanup(func() {
if c != nil {
require.NoError(t, c.Terminate(ctx))
}
})
conn, err := c.ConnectionString(ctx, "sslmode=disable")
if err != nil {