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
[vtadmin] test refactors #7641
[vtadmin] test refactors #7641
Conversation
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>
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.
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
@@ -36,18 +36,24 @@ import ( | |||
) | |||
|
|||
func assertImmediateCaller(t *testing.T, im *querypb.VTGateCallerID, expected string) { | |||
t.Helper() |
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.
TIL
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
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 discovery
that would panic if you tried running it twice, allowing us to run tests now with-count=N
for 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: