test(coderd/database/pubsub): ensure db closure on unhappy paths (#16327)

This commit is contained in:
Mathias Fredriksson
2025-01-29 16:47:38 +02:00
committed by GitHub
parent c069563af1
commit b77b5432c6
2 changed files with 5 additions and 0 deletions

View File

@ -305,6 +305,9 @@ func TestMeasureLatency(t *testing.T) {
require.NoError(t, err)
db, err := sql.Open("postgres", connectionURL)
require.NoError(t, err)
t.Cleanup(func() {
_ = db.Close()
})
ps, err := pubsub.New(ctx, logger, db, connectionURL)
require.NoError(t, err)