MCPcopy
hub / github.com/grpc/grpc-go / verifyHealthCheckErrCode

Function verifyHealthCheckErrCode

test/healthcheck_test.go:889–894  ·  view source on GitHub ↗

verifyHealthCheckErrCode is a helper function to verify that a unary health check RPC returns an error with a code set to 'wantCode'.

(t *testing.T, d time.Duration, cc *grpc.ClientConn, service string, wantCode codes.Code)

Source from the content-addressed store, hash-verified

887// verifyHealthCheckErrCode is a helper function to verify that a unary health
888// check RPC returns an error with a code set to 'wantCode'.
889func verifyHealthCheckErrCode(t *testing.T, d time.Duration, cc *grpc.ClientConn, service string, wantCode codes.Code) {
890 t.Helper()
891 if _, err := healthCheck(d, cc, service); status.Code(err) != wantCode {
892 t.Fatalf("Health/Check() got errCode %v, want %v", status.Code(err), wantCode)
893 }
894}
895
896// newHealthCheckStream is a helper function to start a health check streaming
897// RPC, and returns the stream.

Callers 5

testHealthCheckSuccessFunction · 0.85
testHealthCheckOffFunction · 0.85
testUnknownHandlerFunction · 0.85

Calls 3

CodeFunction · 0.92
healthCheckFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected