Skip to content

Commit 01c935a

Browse files
committed
FIX some tests that rely on the server knobs after interceptors
TestRetriableErrorDuringUpgradedTransaction TestAbortCountConflictingWrites
1 parent 3011460 commit 01c935a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: pkg/sql/conn_executor_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,9 @@ func TestRetriableErrorDuringUpgradedTransaction(t *testing.T) {
899899

900900
var fooTableId uint32
901901
testDB.Exec(t, "SET enable_implicit_transaction_for_batch_statements = true")
902+
// The test injects a retry error after the interceptors, so we need to
903+
// disable write buffers for the request to make it to the server.
904+
testDB.Exec(t, "SEt kv_transaction_buffered_writes_enabled = false")
902905
testDB.Exec(t, "CREATE TABLE bar (a INT PRIMARY KEY)")
903906
testDB.Exec(t, "CREATE TABLE foo (a INT PRIMARY KEY)")
904907
testDB.QueryRow(t, "SELECT 'foo'::regclass::oid").Scan(&fooTableId)

Diff for: pkg/sql/metric_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ func TestAbortCountConflictingWrites(t *testing.T) {
216216

217217
accum := initializeQueryCounter(s)
218218

219+
// The test injects a retry error after the interceptors, so we need to
220+
// disable write buffers for the request to make it to the server.
221+
if _, err := sqlDB.Exec("SEt kv_transaction_buffered_writes_enabled = false"); err != nil {
222+
t.Fatal(err)
223+
}
224+
219225
if _, err := sqlDB.Exec("CREATE DATABASE db"); err != nil {
220226
t.Fatal(err)
221227
}

0 commit comments

Comments
 (0)