What changed, and why it matters
This change only affects test code. It adds cleanup steps to close temporary test databases after unit tests finish. There is no effect on the production LND software or its users, and no security vulnerability is being fixed.
No security action needed. Treat as a normal test-quality improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies sqldb/postgres_fixture.go, adding t.Cleanup callbacks in NewTestPostgresDB and NewTestPostgresDBWithVersion to close store.DB after tests complete. This is a resource-management hygiene improvement for the test harness. It does not alter production code paths, consensus logic, networking, cryptography, or database handling in running nodes.
Changed components
sqldb/postgres_fixture.gotest harness onlyInspect captured patch +8 / −0
diff --git a/sqldb/postgres_fixture.go b/sqldb/postgres_fixture.go
index 91b95d6..6cae3e0 100644
--- a/sqldb/postgres_fixture.go
+++ b/sqldb/postgres_fixture.go
@@ -155,6 +155,10 @@ func NewTestPostgresDB(t testing.TB, fixture *TestPgFixture) *PostgresStore {
context.Background(), GetMigrations()),
)
+ t.Cleanup(func() {
+ require.NoError(t, store.DB.Close())
+ })
+
return store
}
@@ -182,5 +186,9 @@ func NewTestPostgresDBWithVersion(t *testing.T, fixture *TestPgFixture,
err = store.ExecuteMigrations(TargetVersion(version))
require.NoError(t, err)
+ t.Cleanup(func() {
+ require.NoError(t, store.DB.Close())
+ })
+
return store
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.