Skip to content

Commit

Permalink
Fix compose tests
Browse files Browse the repository at this point in the history
In cockroachdb#68608 we upgraded to pgx v4.13, which changed some interface
signatures to accept `context.Context`. The usage was updated almost
everywhere, except some spots.

Release note: None
  • Loading branch information
rail committed Dec 1, 2021
1 parent a80cfbe commit 08e71be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/compose/compare/compare/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ func TestCompare(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer conn.Close()

defer func(conn cmpconn.Conn) {
conn.Close(ctx)
}(conn)

for _, init := range uri.init {
if err := conn.Exec(ctx, init); err != nil {
t.Fatalf("%s: %v", testCn.name, err)
Expand Down Expand Up @@ -182,10 +186,10 @@ func TestCompare(t *testing.T) {
ignoredErrCount++
}
totalQueryCount++
// Make sure we can still ping on a connection. If we can't we may have
// Make sure we can still ping on a connection. If we can't, we may have
// crashed something.
for name, conn := range conns {
if err := conn.Ping(); err != nil {
if err := conn.Ping(ctx); err != nil {
t.Log(query)
t.Fatalf("%s: ping: %v", name, err)
}
Expand Down

0 comments on commit 08e71be

Please sign in to comment.