diff options
author | murgatroid99 <mlumish@google.com> | 2015-05-15 13:36:51 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2015-05-15 13:36:51 -0700 |
commit | 11b8bab22f38e6349bf7dcc0bb1f7b5c2b47f18e (patch) | |
tree | 2c8853dbc29a74629169ce7e68b82c0a9a86584a /src/node/interop/interop_client.js | |
parent | ea43b903a3f2a499752720f0102441dc2694611e (diff) | |
parent | 26d916a9e6318ba35c94c51e0b9eac49816a308a (diff) |
Merge branch 'master' into objective_c_interop_tests
Diffstat (limited to 'src/node/interop/interop_client.js')
-rw-r--r-- | src/node/interop/interop_client.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js index 402843162e..80f811901c 100644 --- a/src/node/interop/interop_client.js +++ b/src/node/interop/interop_client.js @@ -263,6 +263,19 @@ function cancelAfterFirstResponse(client, done) { }); } +function timeoutOnSleepingServer(client, done) { + var deadline = new Date(); + deadline.setMilliseconds(deadline.getMilliseconds() + 1); + var call = client.fullDuplexCall(null, deadline); + call.write({ + payload: {body: zeroBuffer(27182)} + }); + call.on('error', function(error) { + assert.strictEqual(error.code, grpc.status.DEADLINE_EXCEEDED); + done(); + }); +} + /** * Run one of the authentication tests. * @param {string} expected_user The expected username in the response @@ -315,6 +328,7 @@ var test_cases = { empty_stream: emptyStream, cancel_after_begin: cancelAfterBegin, cancel_after_first_response: cancelAfterFirstResponse, + timeout_on_sleeping_server: timeoutOnSleepingServer, compute_engine_creds: _.partial(authTest, COMPUTE_ENGINE_USER, null), service_account_creds: _.partial(authTest, AUTH_USER, AUTH_SCOPE), jwt_token_creds: _.partial(authTest, AUTH_USER, null) |