Skip to content

Commit 8072a38

Browse files
authored
vtgate: Allow additional errors in warnings test (#14461)
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
1 parent 9e80138 commit 8072a38

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

go/test/endtoend/vtgate/errors_as_warnings/main_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,17 @@ func TestScatterErrsAsWarns(t *testing.T) {
140140
utils.Exec(t, mode.conn, "use @replica")
141141
utils.Exec(t, mode.conn, fmt.Sprintf("set workload = %s", mode.m))
142142

143+
expectedWarnings := []string{
144+
"operation not allowed in state NOT_SERVING",
145+
"operation not allowed in state SHUTTING_DOWN",
146+
"no valid tablet",
147+
"no healthy tablet",
148+
"mysql.sock: connect: no such file or directory",
149+
}
143150
utils.AssertMatches(t, mode.conn, query1, `[[INT64(4)]]`)
144-
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")
151+
assertContainsOneOf(t, mode.conn, showQ, expectedWarnings...)
145152
utils.AssertMatches(t, mode.conn, query2, `[[INT64(4)]]`)
146-
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")
153+
assertContainsOneOf(t, mode.conn, showQ, expectedWarnings...)
147154

148155
// invalid_field should throw error and not warning
149156
_, err = mode.conn.ExecuteFetch("SELECT /*vt+ PLANNER=Gen4 SCATTER_ERRORS_AS_WARNINGS */ invalid_field from t1;", 1, false)

0 commit comments

Comments
 (0)