-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error message check on query timeout #16827
Fix error message check on query timeout #16827
Conversation
Signed-off-by: Manan Gupta <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16827 +/- ##
==========================================
- Coverage 69.51% 69.50% -0.01%
==========================================
Files 1568 1569 +1
Lines 202426 202517 +91
==========================================
+ Hits 140717 140763 +46
- Misses 61709 61754 +45 ☔ View full report in Codecov by Sentry. |
assert.ErrorContains(t, err, "DeadlineExceeded desc = context deadline exceeded (errno 1317) (sqlstate 70100)") | ||
// We can get two different error messages based on whether it is coming from vttablet or vtgate | ||
if !strings.Contains(err.Error(), "Query execution was interrupted, maximum statement execution time exceeded") { | ||
assert.ErrorContains(t, err, "DeadlineExceeded desc = context deadline exceeded (errno 1317) (sqlstate 70100)") | ||
} | ||
|
||
// Let's also check that setting the session variable also works. | ||
utils.Exec(t, mcmp.VtConn, "set query_timeout=4000") | ||
_, err = utils.ExecAllowError(t, mcmp.VtConn, "select sleep(u2.id2), u1.id2 from t1 u1 join t1 u2 where u1.id2 = u2.id1") | ||
assert.Error(t, err) | ||
assert.ErrorContains(t, err, "DeadlineExceeded desc = context deadline exceeded (errno 1317) (sqlstate 70100)") | ||
if !strings.Contains(err.Error(), "Query execution was interrupted, maximum statement execution time exceeded") { | ||
assert.ErrorContains(t, err, "DeadlineExceeded desc = context deadline exceeded (errno 1317) (sqlstate 70100)") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at other test in the file.
we just check the deadline error and error code. which is same in both the error messages
TestQueryTimeoutWithTables:
assert.ErrorContains(t, err, "context deadline exceeded")
assert.ErrorContains(t, err, "(errno 1317) (sqlstate 70100)")
Description
This PR fixes the error messages check in the test
TestOverallQueryTimeout
. This is a test we introduced recently and noticed that there are actually two possible error messages that can be received based on whether it was vttablet or vtgate that sent it.This PR fixes the test expectations to align with this.
Related Issue(s)
Checklist
Deployment Notes