mirror of https://github.com/grpc/grpc-node.git
grpc-js-xds: A few fixes for xDS tests
This commit is contained in:
parent
fe198444dc
commit
157882da45
|
@ -59,7 +59,7 @@ GRPC_NODE_TRACE=xds_client,xds_resolver,cds_balancer,eds_balancer,priority,weigh
|
|||
--gcp_suffix=$(date '+%s') \
|
||||
--verbose \
|
||||
${XDS_V3_OPT-} \
|
||||
--client_cmd="$(which node) grpc-node/packages/grpc-js-xds/build/interop/xds-interop-client \
|
||||
--client_cmd="$(which node) --enable-source-maps grpc-node/packages/grpc-js-xds/build/interop/xds-interop-client \
|
||||
--server=xds:///{server_uri} \
|
||||
--stats_port={stats_port} \
|
||||
--qps={qps} \
|
||||
|
|
|
@ -109,7 +109,7 @@ function validateXdsServerConfig(obj: any): XdsServerConfig {
|
|||
return {
|
||||
serverUri: obj.server_uri,
|
||||
channelCreds: obj.channel_creds.map(validateChannelCredsConfig),
|
||||
serverFeatures: obj.server_features
|
||||
serverFeatures: obj.server_features ?? []
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -341,6 +341,16 @@ export class XdsClient {
|
|||
return;
|
||||
}
|
||||
trace('Loaded bootstrap info: ' + JSON.stringify(bootstrapInfo, undefined, 2));
|
||||
if (bootstrapInfo.xdsServers.length < 1) {
|
||||
trace('Failed to initialize xDS Client. No servers provided in bootstrap info.');
|
||||
// Bubble this error up to any listeners
|
||||
this.reportStreamError({
|
||||
code: status.INTERNAL,
|
||||
details: 'Failed to initialize xDS Client. No servers provided in bootstrap info.',
|
||||
metadata: new Metadata(),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (bootstrapInfo.xdsServers[0].serverFeatures.indexOf('xds_v3') >= 0) {
|
||||
this.apiVersion = XdsApiVersion.V3;
|
||||
} else {
|
||||
|
@ -425,8 +435,7 @@ export class XdsClient {
|
|||
{channelOverride: channel}
|
||||
);
|
||||
this.maybeStartLrsStream();
|
||||
},
|
||||
(error) => {
|
||||
}).catch((error) => {
|
||||
trace('Failed to initialize xDS Client. ' + error.message);
|
||||
// Bubble this error up to any listeners
|
||||
this.reportStreamError({
|
||||
|
|
|
@ -309,6 +309,7 @@ export class Server {
|
|||
const http2Server = setupServer();
|
||||
return new Promise<number | Error>((resolve, reject) => {
|
||||
function onError(err: Error): void {
|
||||
trace('Failed to bind ' + subchannelAddressToString(address) + ' with error ' + err.message);
|
||||
resolve(err);
|
||||
}
|
||||
|
||||
|
@ -356,6 +357,7 @@ export class Server {
|
|||
const http2Server = setupServer();
|
||||
return new Promise<BindResult>((resolve, reject) => {
|
||||
function onError(err: Error): void {
|
||||
trace('Failed to bind ' + subchannelAddressToString(address) + ' with error ' + err.message);
|
||||
resolve(bindWildcardPort(addressList.slice(1)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue