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

Function setupBackends

balancer/leastrequest/leastrequest_test.go:148–157  ·  view source on GitHub ↗

setupBackends spins up three test backends, each listening on a port on localhost. The three backends always reply with an empty response with no error, and for streaming receive until hitting an EOF error.

(t *testing.T, numBackends int)

Source from the content-addressed store, hash-verified

146// localhost. The three backends always reply with an empty response with no
147// error, and for streaming receive until hitting an EOF error.
148func setupBackends(t *testing.T, numBackends int) []string {
149 t.Helper()
150 addresses := make([]string, numBackends)
151 backends := startBackends(t, numBackends)
152 // Construct and start working backends.
153 for i := 0; i < numBackends; i++ {
154 addresses[i] = backends[i].Address
155 }
156 return addresses
157}
158
159// checkRoundRobinRPCs verifies that EmptyCall RPCs on the given ClientConn,
160// connected to a server exposing the test.grpc_testing.TestService, are

Callers 3

TestLeastRequestE2EMethod · 0.70
TestConcurrentRPCsMethod · 0.70

Calls 1

startBackendsFunction · 0.70

Tested by

no test coverage detected