Skip to content
Snippets Groups Projects
Commit 2fb16aaf authored by murgatroid99's avatar murgatroid99
Browse files

Fixed ordering assumptions in server_streaming interop test

parent a4c44c2b
No related branches found
No related tags found
No related merge requests found
...@@ -154,13 +154,15 @@ function serverStreaming(client, done) { ...@@ -154,13 +154,15 @@ function serverStreaming(client, done) {
arg.response_parameters[resp_index].size); arg.response_parameters[resp_index].size);
resp_index += 1; resp_index += 1;
}); });
call.on('status', function(status) { call.on('end', function() {
assert.strictEqual(status.code, grpc.status.OK);
assert.strictEqual(resp_index, 4); assert.strictEqual(resp_index, 4);
if (done) { if (done) {
done(); done();
} }
}); });
call.on('status', function(status) {
assert.strictEqual(status.code, grpc.status.OK);
});
} }
/** /**
......
...@@ -81,7 +81,7 @@ function _write(chunk, encoding, callback) { ...@@ -81,7 +81,7 @@ function _write(chunk, encoding, callback) {
batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk); batch[grpc.opType.SEND_MESSAGE] = this.serialize(chunk);
this.call.startBatch(batch, function(err, event) { this.call.startBatch(batch, function(err, event) {
if (err) { if (err) {
// Something has gone wrong. Stop writing by failing to call callback callback(err);
return; return;
} }
callback(); callback();
...@@ -125,11 +125,9 @@ function _read(size) { ...@@ -125,11 +125,9 @@ function _read(size) {
self.finished = true; self.finished = true;
return; return;
} }
if (self.finished) {
self.push(null);
return;
}
var data = event.read; var data = event.read;
var deserialized = self.deserialize(data);
console.log(deserialized);
if (self.push(self.deserialize(data)) && data !== null) { if (self.push(self.deserialize(data)) && data !== null) {
var read_batch = {}; var read_batch = {};
read_batch[grpc.opType.RECV_MESSAGE] = true; read_batch[grpc.opType.RECV_MESSAGE] = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment