Skip to content

Commit

Permalink
Merge pull request #134006 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.3-133987

release-24.3: sql: deflake TestStatementTimeoutForSchemaChangeCommit
  • Loading branch information
rafiss authored Oct 31, 2024
2 parents 75779be + d6d4875 commit 1a8dc6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/sql/run_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ func TestStatementTimeoutForSchemaChangeCommit(t *testing.T) {
require.NoError(t, err)
// Test implicit transactions first.
blockSchemaChange.Swap(true)
defer func() {
close(waitForTimeout)
blockSchemaChange.Swap(false)
}()
if implicitTxn {
_, err := conn.DB.ExecContext(ctx, "ALTER TABLE t1 ADD COLUMN j INT DEFAULT 32")
require.ErrorContains(t, err, sqlerrors.QueryTimeoutError.Error())
Expand All @@ -1030,8 +1034,6 @@ func TestStatementTimeoutForSchemaChangeCommit(t *testing.T) {
err = txn.Commit()
require.NoError(t, err)
}
close(waitForTimeout)
blockSchemaChange.Swap(false)
})
}
}

0 comments on commit 1a8dc6a

Please sign in to comment.