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

Method TestPickerNoRequestHash

balancer/ringhash/picker_test.go:180–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

178}
179
180func (s) TestPickerNoRequestHash(t *testing.T) {
181 ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
182 defer cancel()
183
184 ring, epStates := testRingAndEndpointStates([]connectivity.State{connectivity.Ready})
185 p := &picker{
186 ring: ring,
187 endpointStates: epStates,
188 }
189 if _, err := p.Pick(balancer.PickInfo{Ctx: ctx}); err == nil {
190 t.Errorf("Pick() should have failed with no request hash")
191 }
192}
193
194func (s) TestPickerRequestHashKey(t *testing.T) {
195 tests := []struct {

Callers

nothing calls this directly

Calls 3

PickMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected