aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-05-22 09:49:06 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-05-22 09:49:06 -0700
commit2fb16aafa3254b42c4d53b60c0782fb627154085 (patch)
tree8f71efe1812e51444bd33e8ea020af6825852fc1 /src
parenta4c44c2bcfa8562798b828862532b36cb76a0945 (diff)
Fixed ordering assumptions in server_streaming interop test
Diffstat (limited to 'src')
-rw-r--r--src/node/interop/interop_client.js6
-rw-r--r--src/node/src/client.js8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js
index 80f811901c..455055d9f3 100644
--- a/src/node/interop/interop_client.js
+++ b/src/node/interop/interop_client.js
@@ -154,13 +154,15 @@ function serverStreaming(client, done) {
arg.response_parameters[resp_index].size);
resp_index += 1;
});
- call.on('status', function(status) {
- assert.strictEqual(status.code, grpc.status.OK);
+ call.on('end', function() {
assert.strictEqual(resp_index, 4);
if (done) {
done();
}
});
+ call.on('status', function(status) {
+ assert.strictEqual(status.code, grpc.status.OK);
+ });
}
/**
diff --git a/src/node/src/client.js b/src/node/src/client.js
index efec05bbf3..be1e534707 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -81,7 +81,7 @@ function _write(chunk, encoding, callback) {
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
this.call.startBatch(batch, function(err, event) {
if (err) {
- // Something has gone wrong. Stop writing by failing to call callback
+ callback(err);
return;
}
callback();
@@ -125,11 +125,9 @@ function _read(size) {
self.finished = true;
return;
}
- if (self.finished) {
- self.push(null);
- return;
- }
var data = event.read;
+ var deserialized = self.deserialize(data);
+ console.log(deserialized);
if (self.push(self.deserialize(data)) && data !== null) {
var read_batch = {};
read_batch[grpc.opType.RECV_MESSAGE] = true;