From 39256b7a1a228bdf7e5f305d1573f0c76912701c Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Tue, 9 Aug 2022 10:34:04 -0400 Subject: [PATCH] sql: deflake TestRevertingJobsOnDatabasesAndSchemas The setting of the variable was not in the same session we needed it to be in. Fixes #77048 Release note: None --- pkg/sql/schema_changer_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index 558d4908da4a..1f2813b0e67e 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -6923,8 +6923,7 @@ func TestRevertingJobsOnDatabasesAndSchemas(t *testing.T) { go func(scStmt string) { // This transaction will not return until the server is shutdown. Therefore, // we run it in a separate goroutine and don't check the returned error. - sqlDB.Exec(t, `SET use_declarative_schema_changer = 'off'`) - _, _ = db.Exec(scStmt) + _, _ = db.Exec(`SET use_declarative_schema_changer = 'off'; ` + scStmt) }(tc.scStmt) // Verify that the job is in retry state while reverting. const query = `SELECT num_runs > 3 FROM crdb_internal.jobs WHERE status = '` + string(jobs.StatusReverting) + `' AND description ~ '%s'`