mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Don't expect IPv6 when resolving localhost in tests
This commit is contained in:
parent
7360726e87
commit
1219c46815
@ -80,9 +80,12 @@ describe('Name Resolver', () => {
|
||||
assert(
|
||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 50051 })
|
||||
);
|
||||
// The new test platform doesn't resolve localhost to IPv6
|
||||
/*
|
||||
assert(
|
||||
hasMatchingAddress(endpointList, { host: '::1', port: 50051 })
|
||||
);
|
||||
*/
|
||||
done();
|
||||
return true;
|
||||
};
|
||||
@ -113,7 +116,8 @@ describe('Name Resolver', () => {
|
||||
assert(
|
||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
||||
);
|
||||
assert(hasMatchingAddress(endpointList, { host: '::1', port: 443 }));
|
||||
// The new test platform doesn't resolve localhost to IPv6
|
||||
// assert(hasMatchingAddress(endpointList, { host: '::1', port: 443 }));
|
||||
done();
|
||||
return true;
|
||||
};
|
||||
@ -446,9 +450,12 @@ describe('Name Resolver', () => {
|
||||
assert(
|
||||
hasMatchingAddress(endpointList, { host: '127.0.0.1', port: 443 })
|
||||
);
|
||||
// The new test platform doesn't resolve localhost to IPv6
|
||||
/*
|
||||
assert(
|
||||
hasMatchingAddress(endpointList, { host: '::1', port: 443 })
|
||||
);
|
||||
*/
|
||||
resultCount += 1;
|
||||
if (resultCount === 1) {
|
||||
process.nextTick(() => resolver.updateResolution());
|
||||
|
||||
@ -369,7 +369,7 @@ describe('Server interceptors', () => {
|
||||
},
|
||||
});
|
||||
server.bindAsync(
|
||||
'[::1]:0',
|
||||
'127.0.0.1:0',
|
||||
grpc.ServerCredentials.createInsecure(),
|
||||
(error, port) => {
|
||||
assert.ifError(error);
|
||||
@ -386,8 +386,8 @@ describe('Server interceptors', () => {
|
||||
it('Should get valid connection information', done => {
|
||||
const call = client.sendRequest(done);
|
||||
call.on('metadata', metadata => {
|
||||
assert.strictEqual(metadata.get('local-address')[0], '::1');
|
||||
assert.strictEqual(metadata.get('remote-address')[0], '::1');
|
||||
assert.strictEqual(metadata.get('local-address')[0], '127.0.0.1');
|
||||
assert.strictEqual(metadata.get('remote-address')[0], '127.0.0.1');
|
||||
assert.strictEqual(metadata.get('local-port')[0], `${portNum}`);
|
||||
assert.notStrictEqual(metadata.get('remote-port')[0], 'undefined');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user