mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
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:
@@ -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