TestPickFirst_MultipleBackends tests the scenario with multiple backends and verifies that all RPCs get routed to the first one.
(t *testing.T)
| 177 | // TestPickFirst_MultipleBackends tests the scenario with multiple backends and |
| 178 | // verifies that all RPCs get routed to the first one. |
| 179 | func (s) TestPickFirst_MultipleBackends(t *testing.T) { |
| 180 | cc, r, backends := setupPickFirst(t, 2) |
| 181 | |
| 182 | addrs := stubBackendsToResolverAddrs(backends) |
| 183 | r.UpdateState(resolver.State{Addresses: addrs}) |
| 184 | |
| 185 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 186 | defer cancel() |
| 187 | if err := pickfirst.CheckRPCsToBackend(ctx, cc, addrs[0]); err != nil { |
| 188 | t.Fatal(err) |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // TestPickFirst_OneServerDown tests the scenario where we have multiple |
| 193 | // backends and pick_first is working as expected. Verifies that RPCs get routed |
nothing calls this directly
no test coverage detected