From 62a2f3c809fa1d459380b658145ed620ad900aa5 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Mon, 20 Dec 2021 14:57:28 +0100 Subject: [PATCH] kvdb/postgres: fix tests --- go.mod | 2 +- kvdb/postgres/fixture.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 693c09d3d..0af0bdadf 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/kvdb/postgres/fixture.go b/kvdb/postgres/fixture.go index fe6c323d5..16170f80a 100644 --- a/kvdb/postgres/fixture.go +++ b/kvdb/postgres/fixture.go @@ -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))