Skip to content
Snippets Groups Projects
Commit 02edd87d authored by Tim Emiola's avatar Tim Emiola
Browse files

Merge pull request #1607 from murgatroid99/node_timeout_interop_test

Added Node interop test for timeout_on_sleeping_server
parents e195aa0e d8d21d78
No related branches found
No related tags found
No related merge requests found
...@@ -263,6 +263,19 @@ function cancelAfterFirstResponse(client, done) { ...@@ -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. * Run one of the authentication tests.
* @param {string} expected_user The expected username in the response * @param {string} expected_user The expected username in the response
...@@ -315,6 +328,7 @@ var test_cases = { ...@@ -315,6 +328,7 @@ var test_cases = {
empty_stream: emptyStream, empty_stream: emptyStream,
cancel_after_begin: cancelAfterBegin, cancel_after_begin: cancelAfterBegin,
cancel_after_first_response: cancelAfterFirstResponse, cancel_after_first_response: cancelAfterFirstResponse,
timeout_on_sleeping_server: timeoutOnSleepingServer,
compute_engine_creds: _.partial(authTest, COMPUTE_ENGINE_USER, null), compute_engine_creds: _.partial(authTest, COMPUTE_ENGINE_USER, null),
service_account_creds: _.partial(authTest, AUTH_USER, AUTH_SCOPE), service_account_creds: _.partial(authTest, AUTH_USER, AUTH_SCOPE),
jwt_token_creds: _.partial(authTest, AUTH_USER, null) jwt_token_creds: _.partial(authTest, AUTH_USER, null)
......
...@@ -86,4 +86,8 @@ describe('Interop tests', function() { ...@@ -86,4 +86,8 @@ describe('Interop tests', function() {
interop_client.runTest(port, name_override, 'cancel_after_first_response', interop_client.runTest(port, name_override, 'cancel_after_first_response',
true, true, done); true, true, done);
}); });
it('should pass timeout_on_sleeping_server', function(done) {
interop_client.runTest(port, name_override, 'timeout_on_sleeping_server',
true, true, done);
});
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment