-
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
cleanup: replace dial with newclient #7920
cleanup: replace dial with newclient #7920
Conversation
The tests are failing, please fix the failures. In the future, please ensure that tests pass locally before raising a PR. go test ./... -count=1 -failfast |
I have tested locally before pushing the code, nothing is failing. Let me re-trigger the PR. |
c5b8178
to
76915bd
Compare
The test failure for the new Line 612 in 38a8b9a
This should make the server listen on both the IPv4 and IPv6 localhost addresses. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7920 +/- ##
==========================================
+ Coverage 82.05% 82.29% +0.23%
==========================================
Files 377 379 +2
Lines 38180 38261 +81
==========================================
+ Hits 31330 31487 +157
+ Misses 5549 5491 -58
+ Partials 1301 1283 -18 |
Yeah, it's working, thanks |
test/end2end_test.go
Outdated
@@ -609,7 +609,7 @@ func (te *test) listenAndServe(ts testgrpc.TestServiceServer, listen func(networ | |||
if te.serverInitialConnWindowSize > 0 { | |||
sopts = append(sopts, grpc.InitialConnWindowSize(te.serverInitialConnWindowSize)) | |||
} | |||
la := "localhost:0" | |||
la := "[::]:0" |
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.
@dfawley this is required to fix test failures with the new pickfirst
. localhost
is being resolved to both IPv4 and IPv6 addresses on Github, while net.Listen("tcp", "localhost")
is listening only on the IPv4 address. The resolver list has the IPv4 address followed by the IPv6 one. The old pickfirst reports the first connectivity error while the new pickfirst reports the latest error.
Using [::]
makes the listener bind to all (possibly non-local) interfaces. Is this a concern? We could instead update the test to send "127.0.0.1" through the name resolver.
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.
We should avoid net.Listen("localhost")
, and use net.Listen(":port")
instead. That will make it listen on both ipv4 and ipv6 addresses.
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.
@janardhanvissa can you please change this to ":0"?
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.
Done
balancer/grpclb/grpclb_test.go
Outdated
@@ -460,7 +460,7 @@ func (s) TestGRPCLB_Basic(t *testing.T) { | |||
} | |||
cc, err := grpc.NewClient(r.Scheme()+":///"+beServerName, dopts...) | |||
if err != nil { | |||
t.Fatalf("Failed to dial to the backend %v", err) | |||
t.Fatalf("Failed to create a newclient to the backend %v", err) |
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.
Nit: "... create a client for the backend" everywhere, please.
OR, ("grpc.NewClient(%q) failed unexpectedly: %v", target, err)
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.
Done
test/end2end_test.go
Outdated
@@ -609,7 +609,7 @@ func (te *test) listenAndServe(ts testgrpc.TestServiceServer, listen func(networ | |||
if te.serverInitialConnWindowSize > 0 { | |||
sopts = append(sopts, grpc.InitialConnWindowSize(te.serverInitialConnWindowSize)) | |||
} | |||
la := "localhost:0" | |||
la := "[::]:0" |
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.
We should avoid net.Listen("localhost")
, and use net.Listen(":port")
instead. That will make it listen on both ipv4 and ipv6 addresses.
cc0aa2e
to
647c7d2
Compare
This reverts commit a21e192.
Partially address: #7049
RELEASE NOTES: None