Skip to content

Commit

Permalink
Merge #62682
Browse files Browse the repository at this point in the history
62682: compare_test: check for backends being ready r=otan a=rafiss

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Mar 29, 2021
2 parents 77bd5ee + 0c9c86c commit d891594
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions pkg/compose/compare/compare/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import (
"github.com/cockroachdb/cockroach/pkg/internal/sqlsmith"
"github.com/cockroachdb/cockroach/pkg/sql/mutations"
"github.com/cockroachdb/cockroach/pkg/sql/rowenc"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
"github.com/jackc/pgx/v4"
)

var (
Expand Down Expand Up @@ -102,6 +104,17 @@ func TestCompare(t *testing.T) {
}

ctx := context.Background()

// docker-compose requires us to manually check for when a container
// is ready to receive connections.
// See https://docs.docker.com/compose/startup-order/
for name, uri := range uris {
testutils.SucceedsSoon(t, func() error {
_, err := pgx.Connect(ctx, uri.addr)
return err
})
}

for confName, config := range configs {
t.Run(confName, func(t *testing.T) {
rng, _ := randutil.NewPseudoRand()
Expand Down
2 changes: 1 addition & 1 deletion pkg/compose/compare/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
postgres:
image: postgis/postgis:11-3.0
image: postgis/postgis:13-3.1
environment:
- POSTGRES_INITDB_ARGS=--locale=C
- POSTGRES_HOST_AUTH_METHOD=trust
Expand Down

0 comments on commit d891594

Please sign in to comment.