mirror of https://github.com/grpc/grpc-node.git
Fixed ordering assumptions in server_streaming interop test
This commit is contained in:
parent
9ecee83d9a
commit
6664d4ad01
|
@ -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) {
|
||||||
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) {
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue