Skip to content

Commit e41b99d

Browse files
committed
Fix a couple of issues with tests on Windows
1 parent d5ce784 commit e41b99d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ describe('Client without a server', () => {
7979
after(() => {
8080
client.close();
8181
});
82-
it('should fail multiple calls to the nonexistent server', done => {
82+
it('should fail multiple calls to the nonexistent server', function(done) {
83+
this.timeout(5000);
8384
// Regression test for https://github.com/grpc/grpc-node/issues/1411
8485
client.makeUnaryRequest('/service/method', x => x, x => x, Buffer.from([]), (error, value) => {
8586
assert(error);

test/api/connectivity_test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ const serviceImpl = {
6161
describe(`${anyGrpc.clientName} client -> ${anyGrpc.serverName} server`, function() {
6262
it('client should not wait for ready by default', function(done) {
6363
this.timeout(15000);
64-
const disconnectedClient = new TestServiceClient('foo.test.google.com:50051', clientGrpc.credentials.createInsecure());
64+
/* TCP port 47 is reserved according to
65+
* https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers */
66+
const disconnectedClient = new TestServiceClient('localhost:47', clientGrpc.credentials.createInsecure());
6567
const deadline = new Date();
6668
deadline.setSeconds(deadline.getSeconds() + 10);
6769
disconnectedClient.unary({}, {deadline: deadline}, (error, value) =>{
@@ -72,7 +74,7 @@ describe(`${anyGrpc.clientName} client -> ${anyGrpc.serverName} server`, functio
7274
});
7375
it('client should wait for a connection with waitForReady on', function(done) {
7476
this.timeout(15000);
75-
const disconnectedClient = new TestServiceClient('foo.test.google.com:50051', clientGrpc.credentials.createInsecure());
77+
const disconnectedClient = new TestServiceClient('localhost:47', clientGrpc.credentials.createInsecure());
7678
const metadata = new clientGrpc.Metadata({waitForReady: true});
7779
const deadline = new Date();
7880
deadline.setSeconds(deadline.getSeconds() + 10);

0 commit comments

Comments
 (0)