Skip to content

Commit

Permalink
Fix error formatting based on best practices from Code Review Comments
Browse files Browse the repository at this point in the history
Signed-off-by: CodeLingo Bot <[email protected]>
  • Loading branch information
CodeLingoBot committed Feb 7, 2019
2 parents 53a8cc3 + 80111b6 commit 41bbef1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions test/channelz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func (s) TestCZServerSocketRegistrationAndDeletion(t *testing.T) {

ns, end := channelz.GetServerSockets(ss[0].ID, startID, c.max)
if int64(len(ns)) != c.length || end != c.end {
return false, fmt.Errorf("GetServerSockets(%d) = %+v (len of which: %d), end: %+v, want len(GetServerSockets(%d)) = %d, end: %+v", c.start, ns, len(ns), end, c.start, c.length, c.end)
return false, fmt.Errorf("getServerSockets(%d) = %+v (len of which: %d), end: %+v, want len(GetServerSockets(%d)) = %d, end: %+v", c.start, ns, len(ns), end, c.start, c.length, c.end)
}

svrID = ss[0].ID
Expand Down Expand Up @@ -1320,14 +1320,18 @@ func (s) TestCZSocketGetSecurityValueTLS(t *testing.T) {
return false, fmt.Errorf("the SocketData.Security is of type: %T, want: *credentials.TLSChannelzSecurityValue", skt.SocketData.Security)
}
if !reflect.DeepEqual(securityVal.RemoteCertificate, cert.Certificate[0]) {
return false, fmt.Errorf("SocketData.Security.RemoteCertificate got: %v, want: %v", securityVal.RemoteCertificate, cert.Certificate[0])
return false, fmt.Errorf("socketData.Security.RemoteCertificate got: %v, want: %v", securityVal.RemoteCertificate, cert.Certificate[0])
}
for _, v := range cipherSuites {
if v == securityVal.StandardName {
return true, nil
}
}
<<<<<<< HEAD
return false, fmt.Errorf("SocketData.Security.StandardName got: %v, want it to be one of %v", securityVal.StandardName, cipherSuites)
=======
return false, fmt.Errorf("socketData.Security.StandardName got: %v, want it to be one of %v", securityVal.StandardName, cipherSuites)
>>>>>>> 80111b65a1a6aa3509f27aa6b52eaad9cb0e1952
}); err != nil {
t.Fatal(err)
}
Expand Down
10 changes: 5 additions & 5 deletions test/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (s) TestHealthCheckWithGoAway(t *testing.T) {
// make some rpcs to make sure connection is working.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
return true, nil
}); err != nil {
Expand Down Expand Up @@ -403,7 +403,7 @@ func (s) TestHealthCheckWithConnClose(t *testing.T) {
// make some rpcs to make sure connection is working.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
return true, nil
}); err != nil {
Expand Down Expand Up @@ -553,7 +553,7 @@ func (s) TestHealthCheckWithClientConnClose(t *testing.T) {
// make some rpcs to make sure connection is working.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
return true, nil
}); err != nil {
Expand Down Expand Up @@ -790,7 +790,7 @@ func testHealthCheckDisableWithBalancer(t *testing.T, addr string) {
// send some rpcs to make sure transport has been created and is ready for use.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
return true, nil
}); err != nil {
Expand Down Expand Up @@ -823,7 +823,7 @@ func testHealthCheckDisableWithServiceConfig(t *testing.T, addr string) {
// send some rpcs to make sure transport has been created and is ready for use.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
}
return true, nil
}); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/rawConnWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (rcw *rawConnWrapper) wantAnyFrame() (http2.Frame, error) {
func (rcw *rawConnWrapper) encodeHeaderField(k, v string) error {
err := rcw.hpackEnc.WriteField(hpack.HeaderField{Name: k, Value: v})
if err != nil {
return fmt.Errorf("HPACK encoding error for %q/%q: %v", k, v, err)
return fmt.Errorf("hPACK encoding error for %q/%q: %v", k, v, err)
}
return nil
}
Expand Down

0 comments on commit 41bbef1

Please sign in to comment.