kvdb/postgres: fix tests

This commit is contained in:
Joost Jager
2021-12-20 14:57:28 +01:00
parent 088970e7e8
commit 62a2f3c809
2 changed files with 5 additions and 1 deletions

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))