-
Notifications
You must be signed in to change notification settings - Fork 1.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
transport integration tests: add tests for resource manager #2285
Conversation
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.
This is fantastic! This flow is not immediately obvious, and it's great to have a test that makes sure that we're actually calling the right methods on the resource manager.
Just some super minor nits.
for _, tc := range transportsToTest { | ||
t.Run(tc.Name, func(t *testing.T) { | ||
for _, testDialer := range []bool{true, false} { | ||
t.Run(tc.Name+fmt.Sprintf(" test_dialer=%v", testDialer), func(t *testing.T) { |
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.
Is it ok to capture the loop variable here?
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.
I think so because t.Run blocks on f
https://pkg.go.dev/[email protected]#T.Run. Would not be safe if we did t.Parallel
in here. But I don't think we would. It would be a bit annoying to have f
be returned from a func to get the closured variables in there. So I'm leaning towards leaving it, unless you prefer to change it.
Possibly flaky test here, will investigate |
SetProtocol
callRelated to #2194