From 72443eafe5450642a5d0d5bb240de1dd34a77d1c Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:34:45 +0530 Subject: [PATCH] [release-17.0] vtgate: Allow additional errors in warnings test (#14461) (#14464) Signed-off-by: Dirkjan Bussink Signed-off-by: Harshit Gangal Signed-off-by: deepthi Signed-off-by: Deepthi Sigireddi Signed-off-by: Florent Poinsard Co-authored-by: Dirkjan Bussink Co-authored-by: Deepthi Sigireddi Co-authored-by: Florent Poinsard --- .../endtoend/vtgate/errors_as_warnings/main_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/vtgate/errors_as_warnings/main_test.go b/go/test/endtoend/vtgate/errors_as_warnings/main_test.go index 01eff7b1c34..c1dbc45c421 100644 --- a/go/test/endtoend/vtgate/errors_as_warnings/main_test.go +++ b/go/test/endtoend/vtgate/errors_as_warnings/main_test.go @@ -139,10 +139,17 @@ func TestScatterErrsAsWarns(t *testing.T) { utils.Exec(t, mode.conn, "use @replica") utils.Exec(t, mode.conn, fmt.Sprintf("set workload = %s", mode.m)) + expectedWarnings := []string{ + "operation not allowed in state NOT_SERVING", + "operation not allowed in state SHUTTING_DOWN", + "no valid tablet", + "no healthy tablet", + "mysql.sock: connect: no such file or directory", + } utils.AssertMatches(t, mode.conn, query1, `[[INT64(4)]]`) - assertContainsOneOf(t, mode.conn, showQ, "operation not allowed in state SHUTTING_DOWN", "no valid tablet", "no healthy tablet", "mysql.sock: connect: no such file or directory") + assertContainsOneOf(t, mode.conn, showQ, expectedWarnings...) utils.AssertMatches(t, mode.conn, query2, `[[INT64(4)]]`) - assertContainsOneOf(t, mode.conn, showQ, "operation not allowed in state SHUTTING_DOWN", "no valid tablet", "no healthy tablet", "mysql.sock: connect: no such file or directory") + assertContainsOneOf(t, mode.conn, showQ, expectedWarnings...) // invalid_field should throw error and not warning _, err = mode.conn.ExecuteFetch("SELECT /*vt+ PLANNER=Gen4 SCATTER_ERRORS_AS_WARNINGS */ invalid_field from t1;", 1, false)