TestPickFirst_OneBackend tests the most basic scenario for pick_first. It brings up a single backend and verifies that all RPCs get routed to it.
(t *testing.T)
| 162 | // TestPickFirst_OneBackend tests the most basic scenario for pick_first. It |
| 163 | // brings up a single backend and verifies that all RPCs get routed to it. |
| 164 | func (s) TestPickFirst_OneBackend(t *testing.T) { |
| 165 | cc, r, backends := setupPickFirst(t, 1) |
| 166 | |
| 167 | addrs := stubBackendsToResolverAddrs(backends) |
| 168 | r.UpdateState(resolver.State{Addresses: addrs}) |
| 169 | |
| 170 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 171 | defer cancel() |
| 172 | if err := pickfirst.CheckRPCsToBackend(ctx, cc, addrs[0]); err != nil { |
| 173 | t.Fatal(err) |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | // TestPickFirst_MultipleBackends tests the scenario with multiple backends and |
| 178 | // verifies that all RPCs get routed to the first one. |
nothing calls this directly
no test coverage detected