kvdb/postgres: fix tests

This commit is contained in:
Joost Jager 2021-12-20 14:57:28 +01:00
parent 088970e7e8
commit 62a2f3c809
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
2 changed files with 5 additions and 1 deletions

2
go.mod
View File

@ -46,7 +46,7 @@ require (
github.com/lightningnetwork/lnd/cert v1.1.0
github.com/lightningnetwork/lnd/clock v1.1.0
github.com/lightningnetwork/lnd/healthcheck v1.2.0
github.com/lightningnetwork/lnd/kvdb v1.2.3
github.com/lightningnetwork/lnd/kvdb v1.2.4
github.com/lightningnetwork/lnd/queue v1.1.0
github.com/lightningnetwork/lnd/ticker v1.1.0
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796

View File

@ -26,10 +26,14 @@ func getTestDsn(dbName string) string {
var testPostgres *embeddedpostgres.EmbeddedPostgres
const testMaxConnections = 50
// StartEmbeddedPostgres starts an embedded postgres instance. This only needs
// to be done once, because NewFixture will create random new databases on every
// call. It returns a stop closure that stops the database if called.
func StartEmbeddedPostgres() (func() error, error) {
Init(testMaxConnections)
postgres := embeddedpostgres.NewDatabase(
embeddedpostgres.DefaultConfig().
Port(9876))