From 25af657ad5c6d53f4c03df3887a3486142faa189 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Wed, 24 Jan 2024 20:17:17 +0100 Subject: [PATCH] kvdb: set postgres max_connections on the started instance --- kvdb/postgres/fixture.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kvdb/postgres/fixture.go b/kvdb/postgres/fixture.go index 26d95c33d..449ba8de6 100644 --- a/kvdb/postgres/fixture.go +++ b/kvdb/postgres/fixture.go @@ -27,7 +27,7 @@ func getTestDsn(dbName string) string { var testPostgres *embeddedpostgres.EmbeddedPostgres -const testMaxConnections = 50 +const testMaxConnections = 200 // StartEmbeddedPostgres starts an embedded postgres instance. This only needs // to be done once, because NewFixture will create random new databases on every @@ -37,7 +37,15 @@ func StartEmbeddedPostgres() (func() error, error) { postgres := embeddedpostgres.NewDatabase( embeddedpostgres.DefaultConfig(). - Port(9876)) + Port(9876). + StartParameters( + map[string]string{ + "max_connections": fmt.Sprintf( + "%d", testMaxConnections, + ), + }, + ), + ) err := postgres.Start() if err != nil {