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

Method TestNewServer_ClientCreationFailure

xds/server_test.go:480–488  ·  view source on GitHub ↗

TestNewServer_ClientCreationFailure tests the case where the xDS client creation fails and verifies that the call to NewGRPCServer() fails.

(t *testing.T)

Source from the content-addressed store, hash-verified

478// TestNewServer_ClientCreationFailure tests the case where the xDS client
479// creation fails and verifies that the call to NewGRPCServer() fails.
480func (s) TestNewServer_ClientCreationFailure(t *testing.T) {
481 origXDSClientPool := xdsClientPool
482 xdsClientPool = xdsclient.NewPool(nil)
483 defer func() { xdsClientPool = origXDSClientPool }()
484
485 if _, err := NewGRPCServer(); err == nil {
486 t.Fatal("NewGRPCServer() succeeded when expected to fail")
487 }
488}
489
490// TestHandleListenerUpdate_NoXDSCreds tests the case where an xds-enabled gRPC
491// server is not configured with xDS credentials. Verifies that the security

Callers

nothing calls this directly

Calls 3

NewPoolFunction · 0.92
NewGRPCServerFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected