Skip to content

Commit

Permalink
copy tests: test all supported modes
Browse files Browse the repository at this point in the history
if we run the test in parallel, we always test the latest mode

see here

https://github.com/golang/go/wiki/LoopvarExperiment

also fix a lint warning about pgtype.Vec2
  • Loading branch information
drakkan authored and jackc committed Jun 16, 2023
1 parent b1f8055 commit eb2807b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions copy_from_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
func TestConnCopyWithAllQueryExecModes(t *testing.T) {
for _, mode := range pgxtest.AllQueryExecModes {
t.Run(mode.String(), func(t *testing.T) {
t.Parallel()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

Expand Down Expand Up @@ -81,8 +79,6 @@ func TestConnCopyWithKnownOIDQueryExecModes(t *testing.T) {

for _, mode := range pgxtest.KnownOIDQueryExecModes {
t.Run(mode.String(), func(t *testing.T) {
t.Parallel()

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ func TestConnSimpleProtocol(t *testing.T) {
{
if conn.PgConn().ParameterStatus("crdb_version") == "" {
// CockroachDB doesn't support circle type.
expected := pgtype.Circle{P: pgtype.Vec2{1, 2}, R: 1.5, Valid: true}
expected := pgtype.Circle{P: pgtype.Vec2{X: 1, Y: 2}, R: 1.5, Valid: true}
actual := expected
err := conn.QueryRow(
context.Background(),
Expand Down

0 comments on commit eb2807b

Please sign in to comment.