aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/surface_test.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2017-07-06 10:15:11 -0700
committerGravatar murgatroid99 <mlumish@google.com>2017-07-06 10:15:11 -0700
commit882ba60fcb2cdec28c7d3a2a74914f3a2eeba8e9 (patch)
tree03e2251852bf9cc3fafdc7b20cbaf35e1a2f8d52 /src/node/test/surface_test.js
parent9796c8a31af5b91e4c98281a0a6cd768d52d5e77 (diff)
parent9780f9364664a359ebf6f5fc11dda7782785c20c (diff)
Merge remote-tracking branch 'upstream/v1.4.x' into master_1.4.1_upmerge
Diffstat (limited to 'src/node/test/surface_test.js')
-rw-r--r--src/node/test/surface_test.js24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js
index d58d18057e..0b0b393e32 100644
--- a/src/node/test/surface_test.js
+++ b/src/node/test/surface_test.js
@@ -1398,13 +1398,25 @@ describe('Client reconnect', function() {
});
server.bind('localhost:' + port, server_insecure_creds);
server.start();
- client.echo(undefined, function(error, response) {
- if (error) {
- console.log(error);
- }
+
+ /* We create a new client, that will not throw an error if the server
+ * is not immediately available. Instead, it will wait for the server
+ * to be available, then the call will complete. Once this happens, the
+ * original client should be able to make a new call and connect to the
+ * restarted server without having the call fail due to connection
+ * errors. */
+ var client2 = new Client('localhost:' + port,
+ grpc.credentials.createInsecure());
+ client2.echo({value: 'test', value2: 3}, function(error, response) {
assert.ifError(error);
- assert.deepEqual(response, {value: '', value2: 0});
- done();
+ client.echo(undefined, function(error, response) {
+ if (error) {
+ console.log(error);
+ }
+ assert.ifError(error);
+ assert.deepEqual(response, {value: '', value2: 0});
+ done();
+ });
});
});
});