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) {
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);
});
}
/**
......
......@@ -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;
......
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