Merged in feature/timeout (pull request #138)
Remove race conditions from -race in tests * timeout * raceconditions * nobuildgp * build * perf
This commit is contained in:
@@ -3,7 +3,6 @@ package test
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
db "queryorchestration/internal/database"
|
||||
@@ -24,8 +23,6 @@ const (
|
||||
dbPort = 5432
|
||||
)
|
||||
|
||||
var dbLock sync.Mutex
|
||||
|
||||
func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dcfg *CreateDatabaseConfig) testcontainers.Container {
|
||||
port, err := nat.NewPort("tcp", strconv.Itoa(dbPort))
|
||||
require.NoError(t, err)
|
||||
@@ -59,8 +56,6 @@ func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dc
|
||||
},
|
||||
}
|
||||
|
||||
dbLock.Lock()
|
||||
|
||||
container, err := testcontainers.GenericContainer(t.Context(), testcontainers.GenericContainerRequest{
|
||||
ContainerRequest: req,
|
||||
Started: true,
|
||||
@@ -73,8 +68,6 @@ func CreateDB(t testing.TB, cfg serviceconfig.ConfigProvider, network string, dc
|
||||
mappedPort, err := container.MappedPort(t.Context(), port)
|
||||
require.NoError(t, err)
|
||||
|
||||
dbLock.Unlock()
|
||||
|
||||
cfg.SetDBHost(host)
|
||||
cfg.SetDBPort(mappedPort.Int())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user