Skip to content

Commit c52cb84

Browse files
committed
Add detailed assertion output for some resolver tests, skip IPv4+IPv6 test
1 parent 40c2f61 commit c52cb84

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/grpc-js/test/test-resolver.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import * as resolver_uds from '../src/resolver-uds';
2424
import * as resolver_ip from '../src/resolver-ip';
2525
import { ServiceConfig } from '../src/service-config';
2626
import { StatusObject } from '../src/call-stream';
27-
import { SubchannelAddress, isTcpSubchannelAddress } from "../src/subchannel-address";
27+
import { SubchannelAddress, isTcpSubchannelAddress, subchannelAddressToString } from "../src/subchannel-address";
2828
import { parseUri, GrpcUri } from '../src/uri-parser';
2929

3030
describe('Name Resolver', () => {
@@ -223,7 +223,7 @@ describe('Name Resolver', () => {
223223
isTcpSubchannelAddress(addr) &&
224224
addr.host === '127.0.0.1' &&
225225
addr.port === 443
226-
)
226+
), `None of [${addressList.map(addr => subchannelAddressToString(addr))}] matched '127.0.0.1:443'`
227227
);
228228
done();
229229
},
@@ -263,7 +263,10 @@ describe('Name Resolver', () => {
263263
const resolver = resolverManager.createResolver(target, listener, {});
264264
resolver.updateResolution();
265265
});
266-
it('Should resolve a DNS name to IPv4 and IPv6 addresses', done => {
266+
/* This DNS name resolves to only the IPv4 address on Windows, and only the
267+
* IPv6 address on Mac. There is no result that we can consistently test
268+
* for here. */
269+
it.skip('Should resolve a DNS name to IPv4 and IPv6 addresses', done => {
267270
const target = resolverManager.mapUriDefaultScheme(parseUri('loopback46.unittest.grpc.io')!)!;
268271
const listener: resolverManager.ResolverListener = {
269272
onSuccessfulResolution: (
@@ -279,7 +282,7 @@ describe('Name Resolver', () => {
279282
isTcpSubchannelAddress(addr) &&
280283
addr.host === '127.0.0.1' &&
281284
addr.port === 443
282-
)
285+
), `None of [${addressList.map(addr => subchannelAddressToString(addr))}] matched '127.0.0.1:443'`
283286
);
284287
/* TODO(murgatroid99): check for IPv6 result, once we can get that
285288
* consistently */

0 commit comments

Comments
 (0)