aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-05-19 21:54:40 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-05-19 21:54:40 -0700
commitd17403c6d235a5a3a6dfddd8f3c741871b70256a (patch)
tree539f693437fbb67859a0208368ed1ce91c93180d
parentd0ffe1431728f59556dd535df8edf0f3003649ae (diff)
Correctly handle reading the final message and then sending status
-rw-r--r--src/node/test/end_to_end_test.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js
index 60e9861bc8..667852f382 100644
--- a/src/node/test/end_to_end_test.js
+++ b/src/node/test/end_to_end_test.js
@@ -286,20 +286,24 @@ describe('end-to-end', function() {
assert.ifError(err);
assert(response['send metadata']);
assert.strictEqual(response.read.toString(), requests[0]);
- var end_batch = {};
- end_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
- end_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
- 'metadata': {},
- 'code': grpc.status.OK,
- 'details': status_text
- };
- end_batch[grpc.opType.RECV_MESSAGE] = true;
- server_call.startBatch(end_batch, function(err, response) {
+ var snd_batch = {};
+ snd_batch[grpc.opType.RECV_MESSAGE] = true;
+ server_call.startBatch(snd_batch, function(err, response) {
assert.ifError(err);
- assert(response['send status']);
- assert(!response.cancelled);
assert.strictEqual(response.read.toString(), requests[1]);
- done();
+ var end_batch = {};
+ end_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
+ end_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
+ 'metadata': {},
+ 'code': grpc.status.OK,
+ 'details': status_text
+ };
+ server_call.startBatch(end_batch, function(err, response) {
+ assert.ifError(err);
+ assert(response['send status']);
+ assert(!response.cancelled);
+ done();
+ });
});
});
});