(states []connectivity.State)
| 74 | } |
| 75 | |
| 76 | func testRingAndEndpointStates(states []connectivity.State) (*ring, map[string]endpointState) { |
| 77 | var items []*ringEntry |
| 78 | epStates := map[string]endpointState{} |
| 79 | for i, st := range states { |
| 80 | testSC := testSubConns[i] |
| 81 | items = append(items, &ringEntry{ |
| 82 | idx: i, |
| 83 | hash: math.MaxUint64 / uint64(len(states)) * uint64(i), |
| 84 | hashKey: testSC.String(), |
| 85 | }) |
| 86 | epState := endpointState{ |
| 87 | state: balancer.State{ |
| 88 | ConnectivityState: st, |
| 89 | Picker: &fakeChildPicker{ |
| 90 | connectivityState: st, |
| 91 | tfError: fmt.Errorf("%d: %w", i, errPicker), |
| 92 | subConn: testSC, |
| 93 | }, |
| 94 | }, |
| 95 | balancer: &fakeExitIdler{ |
| 96 | sc: testSC, |
| 97 | }, |
| 98 | } |
| 99 | epStates[testSC.String()] = epState |
| 100 | } |
| 101 | return &ring{items: items}, epStates |
| 102 | } |
| 103 | |
| 104 | func (s) TestPickerPickFirstTwo(t *testing.T) { |
| 105 | tests := []struct { |
no test coverage detected