Skip to content

Commit

Permalink
sql/schema_changer_test.go not checking err, fix for linting issue
Browse files Browse the repository at this point in the history
Methods that returned an err were not checked in PR cockroachdb#123414 which is
causing an failure with our lint test, this PR contains those err checks.

Informs: cockroachdb#123414

Release note: None
  • Loading branch information
Dedej-Bergin committed May 14, 2024
1 parent ab7cebf commit 01e574a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/sql/schema_changer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7839,11 +7839,14 @@ func TestLeaseTimeoutWithConcurrentTransactions(t *testing.T) {
sqlRunner.Exec(t, `CREATE TABLE RIDES (my_int INT);`)

txn1 := sqlRunner.Begin(t)
txn1.Exec(`SELECT * FROM PROMO_CODES;`)
_, err := txn1.Exec(`SELECT * FROM PROMO_CODES;`)
require.NoError(t, err)

txn2 := sqlRunner.Begin(t)
txn2.Exec(`GRANT ALL ON TABLE PROMO_CODES TO ROACHMIN;`)
txn2.Exec(`GRANT ALL ON TABLE RIDES TO ROACHMIN;`)
_, err = txn2.Exec(`GRANT ALL ON TABLE PROMO_CODES TO ROACHMIN;`)
require.NoError(t, err)
_, err = txn2.Exec(`GRANT ALL ON TABLE RIDES TO ROACHMIN;`)
require.NoError(t, err)

blocker := make(chan struct{})
group := ctxgroup.WithContext(ctx)
Expand All @@ -7855,7 +7858,7 @@ func TestLeaseTimeoutWithConcurrentTransactions(t *testing.T) {
})

<-blocker
_, err := txn1.Exec("INSERT INTO promo_codes values (1)")
_, err = txn1.Exec("INSERT INTO promo_codes values (1)")
require.NoError(t, err)

// txn1.commit() completes with an error due to lease timeout on txn2.commit().
Expand Down

0 comments on commit 01e574a

Please sign in to comment.