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

Function verifyError

internal/xds/xdsdepmgr/xds_dependency_manager_test.go:124–140  ·  view source on GitHub ↗
(ctx context.Context, errCh chan error, wantErr, wantNodeID string)

Source from the content-addressed store, hash-verified

122}
123
124func verifyError(ctx context.Context, errCh chan error, wantErr, wantNodeID string) error {
125 select {
126 case gotErr := <-errCh:
127 if gotErr == nil {
128 return fmt.Errorf("got nil error from resolver, want error %q", wantErr)
129 }
130 if !strings.Contains(gotErr.Error(), wantErr) {
131 return fmt.Errorf("got error from resolver %q, want %q", gotErr, wantErr)
132 }
133 if !strings.Contains(gotErr.Error(), wantNodeID) {
134 return fmt.Errorf("got error from resolver %q, want nodeID %q", gotErr, wantNodeID)
135 }
136 case <-ctx.Done():
137 return fmt.Errorf("timeout waiting for error from dependency manager")
138 }
139 return nil
140}
141
142// setupManagementServerAndClient creates a management server, an xds client and
143// returns the node ID, management server and xds client.

Calls 3

ErrorfMethod · 0.65
ErrorMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected