[vtadmin] test refactors#7641
Merged
rohit-nayak-ps merged 11 commits intovitessio:masterfrom Mar 9, 2021
Merged
Conversation
added 10 commits
March 8, 2021 13:56
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Also, switch `TestRegister` to use nanos to dedupe test cases that are running highly concurrently. Signed-off-by: Andrew Mason <amason@slack-corp.com>
… test function Signed-off-by: Andrew Mason <amason@slack-corp.com>
setassociative
left a comment
There was a problem hiding this comment.
generally this seems positive; the failure on the race check suggests to me there is work to be done around how we handle test bootstrapping and standing up grpc endpoints
| ) | ||
|
|
||
| func assertImmediateCaller(t *testing.T, im *querypb.VTGateCallerID, expected string) { | ||
| t.Helper() |
87f2cba to
6f70970
Compare
Two changes: - I missed a couple places to transition from the direct, `grpcvtctldserver.NewVtctldServer` to the indirect `testutil.NewVtctldServerWithTabletManagerClient`, which guards against data races in the tabletmanager protocol registry. - Added a call to `grpccommon.EnableTracingOpt()` in the `init` of vtadmin's tests, to force the one-time write to occur before any concurrent tests start up and try to read that value. Signed-off-by: Andrew Mason <amason@slack-corp.com>
6f70970 to
3f7e006
Compare
doeg
approved these changes
Mar 9, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR contains a bunch of miscellaneous refactors to vtadmin tests, namely:
t.Run(...)) in places where it was previously missingt.Parallel()in most placespackage discoverythat would panic if you tried running it twice, allowing us to run tests now with-count=Nfor N > 1.context.Background()calls with a single, shared context per test functionRelated Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: