kvdb: set postgres max_connections on the started instance

This commit is contained in:
Andras Banki-Horvath 2024-01-24 20:17:17 +01:00
parent 524fa66abf
commit 25af657ad5
No known key found for this signature in database
GPG key ID: 80E5375C094198D8

View file

@ -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 {