Further fixed connectivity tests

pull/2696/head
murgatroid99 10 years ago
parent 371354673f
commit 296a369915
  1. 2
      src/node/src/client.js
  2. 4
      src/node/test/surface_test.js

@ -575,7 +575,7 @@ exports.makeClientConstructor = function(methods, serviceName) {
if (err) {
callback(new Error('Failed to connect before the deadline'));
}
var new_state = this.channel.getConnectivityState(true);
var new_state = self.channel.getConnectivityState(true);
if (new_state === grpc.connectivityState.READY) {
callback();
} else if (new_state === grpc.connectivityState.FATAL_FAILURE) {

@ -139,7 +139,7 @@ describe('Client#$waitForReady', function() {
var client;
before(function() {
server = new grpc.Server();
port = server.bind('localhost:0');
port = server.bind('localhost:0', grpc.ServerCredentials.createInsecure());
server.start();
Client = surface_client.makeProtobufClientConstructor(mathService);
});
@ -173,7 +173,6 @@ describe('Client#$waitForReady', function() {
assert.ifError(error);
done();
});
client.$tryConnect();
});
it('should complete if called when already ready', function(done) {
client.$waitForReady(Infinity, function(error) {
@ -183,7 +182,6 @@ describe('Client#$waitForReady', function() {
done();
});
});
client.$tryConnect();
});
});
describe('Echo service', function() {

Loading…
Cancel
Save