htlcswitch: clean up test resources and temporary files
The htlcswitch tests were creating temporary database files but failing to clean them up. We fix this by making it obvious when temporary db files are created, and cleaning up those resources where necessary in the tests.
This commit is contained in:
1 parent
406fc86f38
commit
63428de6e5
6 files changed
+84
-50
No files matched your search
@@ -628,6 +628,7 @@ func makeCircuitDB(t *testing.T, path string) *channeldb.DB {
|
||||
|
||||
db, err := channeldb.Open(path)
|
||||
require.NoError(t, err, "unable to open channel db")
|
||||
t.Cleanup(func() { db.Close() })
|
||||
|
||||
return db
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user