grpclb: fix possible nil before conversion in TestDropRequest (#5022)

This commit is contained in:
Shihao Xia 2021-12-22 15:41:46 -05:00 committed by GitHub
parent 8ae11f4622
commit ec7cf6c977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -656,7 +656,7 @@ func (s) TestDropRequest(t *testing.T) {
for i := 0; i < 3; i++ {
var p peer.Peer
if _, err := testC.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true), grpc.Peer(&p)); err != nil {
t.Errorf("%v.EmptyCall(_, _) = _, %v, want _, <nil>", testC, err)
t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, <nil>", testC, err)
}
if want := tss.bePorts[1]; p.Addr.(*net.TCPAddr).Port != want {
t.Errorf("got peer: %v, want peer port: %v", p.Addr, want)
@ -667,7 +667,7 @@ func (s) TestDropRequest(t *testing.T) {
}
if _, err := testC.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true), grpc.Peer(&p)); err != nil {
t.Errorf("%v.EmptyCall(_, _) = _, %v, want _, <nil>", testC, err)
t.Fatalf("%v.EmptyCall(_, _) = _, %v, want _, <nil>", testC, err)
}
if want := tss.bePorts[1]; p.Addr.(*net.TCPAddr).Port != want {
t.Errorf("got peer: %v, want peer port: %v", p.Addr, want)