Skip to content

Commit

Permalink
vtgate: Allow additional errors in warnings test
Browse files Browse the repository at this point in the history
There's an additional error that we can see in this errors as warnings
check.

It refactors it slightly to have one list instead that isn't on a huge
single line.

Signed-off-by: Dirkjan Bussink <[email protected]>
  • Loading branch information
dbussink committed Nov 4, 2023
1 parent 9e80138 commit 083c322
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions go/test/endtoend/vtgate/errors_as_warnings/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,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)
Expand Down

0 comments on commit 083c322

Please sign in to comment.