From 7657589ad32cf900d88e7f60abe8e4ff9f8f0e3d Mon Sep 17 00:00:00 2001 From: David Piegza <697113+davidpiegza@users.noreply.github.com> Date: Wed, 30 Aug 2023 08:59:20 +0000 Subject: [PATCH] Update tests Signed-off-by: David Piegza <697113+davidpiegza@users.noreply.github.com> --- go/vt/vtgate/executor_vschema_ddl_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/go/vt/vtgate/executor_vschema_ddl_test.go b/go/vt/vtgate/executor_vschema_ddl_test.go index f19842d4dd0..4218dcf93e0 100644 --- a/go/vt/vtgate/executor_vschema_ddl_test.go +++ b/go/vt/vtgate/executor_vschema_ddl_test.go @@ -389,7 +389,7 @@ func TestExecutorDropSequenceDDL(t *testing.T) { defer func() { vschemaacl.AuthorizedDDLUsers = "" }() - executor, _, _, _ := createExecutorEnv() + executor, _, _, _, ctx := createExecutorEnv(t) ks := KsTestUnsharded vschema := executor.vm.GetCurrentSrvVschema() @@ -408,7 +408,7 @@ func TestExecutorDropSequenceDDL(t *testing.T) { // add test sequence stmt := "alter vschema add sequence test_seq" - _, err := executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err := executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) require.NoError(t, err) _ = waitForVschemaTables(t, ks, append(vschemaTables, []string{"test_seq"}...), executor) vschema = executor.vm.GetCurrentSrvVschema() @@ -420,14 +420,14 @@ func TestExecutorDropSequenceDDL(t *testing.T) { // drop existing test sequence stmt = "alter vschema drop sequence test_seq" - _, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err = executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) require.NoError(t, err) // Should fail dropping a non-existing test sequence session = NewSafeSession(&vtgatepb.Session{TargetString: ks}) stmt = "alter vschema drop sequence test_seq" - _, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err = executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) wantErr := "vschema does not contain sequence test_seq in keyspace TestUnsharded" if err == nil || err.Error() != wantErr { @@ -440,17 +440,17 @@ func TestExecutorDropAutoIncDDL(t *testing.T) { defer func() { vschemaacl.AuthorizedDDLUsers = "" }() - executor, _, _, _ := createExecutorEnv() + executor, _, _, _, ctx := createExecutorEnv(t) ks := KsTestUnsharded session := NewSafeSession(&vtgatepb.Session{TargetString: ks}) stmt := "alter vschema add table test_table" - _, err := executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err := executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) require.NoError(t, err) stmt = "alter vschema on test_table add auto_increment id using `db-name`.`test_seq`" - _, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err = executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) require.NoError(t, err) wantAutoInc := &vschemapb.AutoIncrement{Column: "id", Sequence: "`db-name`.test_seq"} @@ -461,7 +461,7 @@ func TestExecutorDropAutoIncDDL(t *testing.T) { } stmt = "alter vschema on test_table drop auto_increment" - _, err = executor.Execute(context.Background(), "TestExecute", session, stmt, nil) + _, err = executor.Execute(ctx, nil, "TestExecute", session, stmt, nil) require.NoError(t, err) if executor.vm.GetCurrentSrvVschema().Keyspaces[ks].Tables["test_table"].AutoIncrement != nil {