-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
resolver: manual resolver crashes if grpc.Dial isn't called before some methods #6754
resolver: manual resolver crashes if grpc.Dial isn't called before some methods #6754
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 mostly LGTM to me, thanks.
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.
LGTM modulo the date thing. Thanks!
resolver/manual/manual_test.go
Outdated
@@ -1,3 +1,21 @@ | |||
/* | |||
* | |||
* Copyright 2017 gRPC authors. |
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.
Please update to 2023.
@arvindbr8 PTAL; thanks! |
resolver/manual/manual_test.go
Outdated
}, | ||
}) | ||
|
||
t.Run("update_state", 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.
I would prefer if the sub test description said not just update_state
. This subtest asserts the panic message when updateState fails. So maybe something like
t.Run("update_state", func(t *testing.T) { | |
t.Run("update_state_panics", func(t *testing.T) { |
resolver/manual/manual_test.go
Outdated
{Addr: "anotheraddress"}, | ||
}}) | ||
}) | ||
t.Run("report_error", 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.
Similarly for report_error
resolver/manual/manual_test.go
Outdated
r.ReportError(errors.New("example")) | ||
}) | ||
|
||
_, err := grpc.Dial("whatever://localhost", |
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 seems like another subTest to me. I would prefer if we did this also inside of a t.Run("happy path", func(t *testing.T)
Add panic message when manual resolver crashes if
grpc.Dial()
isn't called before setting ClientConnRELEASE NOTES: none