From 88f90ef0a55783ee6c27495b718eb3d438582506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 May 2024 12:54:18 +0200 Subject: [PATCH] Manager: properly close database at end of test Instead of closing the sqlite database connection, tell GORM to close the connection. Only that properly closes the DB, so that testing with a file on disk doesn't fail when trying to delete that file. No functional changes to the Manager itself. --- internal/manager/persistence/test_support.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/manager/persistence/test_support.go b/internal/manager/persistence/test_support.go index a0c2a92f..78276b4c 100644 --- a/internal/manager/persistence/test_support.go +++ b/internal/manager/persistence/test_support.go @@ -60,7 +60,7 @@ func CreateTestDB(t *testing.T) (db *DB, closer func()) { } closer = func() { - if err := sqliteConn.Close(); err != nil { + if err := db.Close(); err != nil { t.Fatalf("closing DB: %v", err) } }