package store_test import ( "fmt" "os" "testing" "github.com/stretchr/testify/require" ) // TestMain's Postgres already holds a port. A second instance started in the // same process must still come up, i.e. the port is not derived from something // two starters share (the PID). Observes: startTestPostgres succeeds while // another instance from this process is listening. func TestStartTestPostgres_SecondInstanceStartsWhileFirstHoldsItsPort(t *testing.T) { pg, _, rt, err := startTestPostgres(fmt.Sprintf("tapir-epg-store-second-%d", os.Getpid())) require.NoError(t, err) t.Cleanup(func() { _ = pg.Stop(); _ = os.RemoveAll(rt) }) }