Skip to content
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

Merged
merged 4 commits into from
Nov 7, 2023

Conversation

henvic
Copy link
Contributor

@henvic henvic commented Oct 30, 2023

Add panic message when manual resolver crashes if grpc.Dial() isn't called before setting ClientConn

RELEASE NOTES: none

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #6754 (d0b969c) into master (8cb9846) will increase coverage by 0.12%.
Report is 7 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

@ginayeh ginayeh added this to the 1.60 Release milestone Oct 31, 2023
@dfawley dfawley self-requested a review October 31, 2023 16:42
@dfawley dfawley self-assigned this Oct 31, 2023
Copy link
Member

@dfawley dfawley left a 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.

resolver/manual/manual_test.go Show resolved Hide resolved
resolver/manual/manual.go Show resolved Hide resolved
resolver/manual/manual.go Show resolved Hide resolved
resolver/manual/manual.go Outdated Show resolved Hide resolved
Copy link
Member

@dfawley dfawley left a 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!

@@ -1,3 +1,21 @@
/*
*
* Copyright 2017 gRPC authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to 2023.

@dfawley
Copy link
Member

dfawley commented Nov 6, 2023

@arvindbr8 PTAL; thanks!

},
})

t.Run("update_state", func(t *testing.T) {
Copy link
Member

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

Suggested change
t.Run("update_state", func(t *testing.T) {
t.Run("update_state_panics", func(t *testing.T) {

{Addr: "anotheraddress"},
}})
})
t.Run("report_error", func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly for report_error

r.ReportError(errors.New("example"))
})

_, err := grpc.Dial("whatever://localhost",
Copy link
Member

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)

@arvindbr8 arvindbr8 removed their assignment Nov 6, 2023
@arvindbr8 arvindbr8 merged commit 3fe1123 into grpc:master Nov 7, 2023
13 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants