Skip to content

Commit

Permalink
Merge #124128
Browse files Browse the repository at this point in the history
124128: sql/schema_changer_test.go not checking err, fix for linting issue r=Dedej-Bergin a=Dedej-Bergin

Methods that returned an err were not checked in PR #123414 which is causing a failure with our lint test, this PR contains those err checks.

Informs: #123414

Release note: None

Co-authored-by: Bergin Dedej <[email protected]>
  • Loading branch information
craig[bot] and Dedej-Bergin committed May 14, 2024
2 parents ab7cebf + 01e574a commit 622c49c
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 622c49c

Please sign in to comment.