func testHealthCheckOnFailure(t *testing.T, e env) { s, cc := setUp(true, math.MaxUint32, e) defer tearDown(s, cc) if err := health.HealthCheck(0*time.Second, cc); err != grpc.Errorf(codes.DeadlineExceeded, "context deadline exceeded") { t.Fatalf("HealthCheck(_)=_, %v, want error code %d", err, codes.DeadlineExceeded) } }
func testHealthCheckOnSuccess(t *testing.T, e env) { s, cc := setUp(true, math.MaxUint32, e) defer tearDown(s, cc) if err := health.HealthCheck(1*time.Second, cc); err != nil { t.Fatalf("HealthCheck(_)=_, %v, want <nil>", err) } }
func testHealthCheckOff(t *testing.T, e env) { s, cc := setUp(false, math.MaxUint32, e) defer tearDown(s, cc) err := health.HealthCheck(1*time.Second, cc) if err != grpc.Errorf(codes.Unimplemented, "unknown service grpc.health.HealthCheck") { t.Fatalf("HealthCheck(_)=_, %v, want error code %d", err, codes.DeadlineExceeded) } }