From e5dbc203c2f8a20b1a15133f341656f0f6a46a8b Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 14 Oct 2022 09:51:19 +0000 Subject: [PATCH] test: added e2e test Signed-off-by: Harshit Gangal --- go/vt/vttablet/endtoend/framework/server.go | 2 ++ go/vt/vttablet/endtoend/reserve_test.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/go/vt/vttablet/endtoend/framework/server.go b/go/vt/vttablet/endtoend/framework/server.go index ade79b5d89..1f5b719d77 100644 --- a/go/vt/vttablet/endtoend/framework/server.go +++ b/go/vt/vttablet/endtoend/framework/server.go @@ -116,6 +116,8 @@ func StartServer(connParams, connAppDebugParams mysql.ConnParams, dbName string) config.SignalSchemaChangeReloadIntervalSeconds = tabletenv.Seconds(2.1) config.SignalWhenSchemaChange = true config.Healthcheck.IntervalSeconds = 0.1 + config.Oltp.TxTimeoutSeconds = 5 + config.Olap.TxTimeoutSeconds = 5 gotBytes, _ := yaml2.Marshal(config) log.Infof("Config:\n%s", gotBytes) return StartCustomServer(connParams, connAppDebugParams, dbName, config) diff --git a/go/vt/vttablet/endtoend/reserve_test.go b/go/vt/vttablet/endtoend/reserve_test.go index 095370453c..355e4d5b95 100644 --- a/go/vt/vttablet/endtoend/reserve_test.go +++ b/go/vt/vttablet/endtoend/reserve_test.go @@ -1032,3 +1032,17 @@ func TestFailInfiniteSessions(t *testing.T) { client.Release()) } } + +func TestReserveQueryTimeout(t *testing.T) { + client := framework.NewClient() + + _, err := client.ReserveExecute("select sleep(19)", []string{"set sql_mode = ''"}, nil) + assert.NoError(t, err) + assert.NoError(t, + client.Release()) + + _, err = client.ReserveStreamExecute("select sleep(19)", []string{"set sql_mode = ''"}, nil) + assert.NoError(t, err) + assert.NoError(t, + client.Release()) +}