mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-06 04:59:34 +02:00
kvdb/postgres: fix tests
This commit is contained in:
parent
088970e7e8
commit
62a2f3c809
2
go.mod
2
go.mod
@ -46,7 +46,7 @@ require (
|
|||||||
github.com/lightningnetwork/lnd/cert v1.1.0
|
github.com/lightningnetwork/lnd/cert v1.1.0
|
||||||
github.com/lightningnetwork/lnd/clock v1.1.0
|
github.com/lightningnetwork/lnd/clock v1.1.0
|
||||||
github.com/lightningnetwork/lnd/healthcheck v1.2.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/queue v1.1.0
|
||||||
github.com/lightningnetwork/lnd/ticker v1.1.0
|
github.com/lightningnetwork/lnd/ticker v1.1.0
|
||||||
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
|
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
|
||||||
|
@ -26,10 +26,14 @@ func getTestDsn(dbName string) string {
|
|||||||
|
|
||||||
var testPostgres *embeddedpostgres.EmbeddedPostgres
|
var testPostgres *embeddedpostgres.EmbeddedPostgres
|
||||||
|
|
||||||
|
const testMaxConnections = 50
|
||||||
|
|
||||||
// StartEmbeddedPostgres starts an embedded postgres instance. This only needs
|
// StartEmbeddedPostgres starts an embedded postgres instance. This only needs
|
||||||
// to be done once, because NewFixture will create random new databases on every
|
// 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.
|
// call. It returns a stop closure that stops the database if called.
|
||||||
func StartEmbeddedPostgres() (func() error, error) {
|
func StartEmbeddedPostgres() (func() error, error) {
|
||||||
|
Init(testMaxConnections)
|
||||||
|
|
||||||
postgres := embeddedpostgres.NewDatabase(
|
postgres := embeddedpostgres.NewDatabase(
|
||||||
embeddedpostgres.DefaultConfig().
|
embeddedpostgres.DefaultConfig().
|
||||||
Port(9876))
|
Port(9876))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user