mirror of https://github.com/grpc/grpc-node.git
Fix tests for fixed code, also fix another issue
This commit is contained in:
parent
9aeca2f01a
commit
1ee218c8bd
|
@ -130,7 +130,16 @@ export class Http2CallStream extends Duplex implements Call {
|
|||
private endCall(status: StatusObject): void {
|
||||
if (this.finalStatus === null) {
|
||||
this.finalStatus = status;
|
||||
this.emit('status', status);
|
||||
/* We do this asynchronously to ensure that no async function is in the
|
||||
* call stack when we return control to the application. If an async
|
||||
* function is in the call stack, any exception thrown by the application
|
||||
* (or our tests) will bubble up and turn into promise rejection, which
|
||||
* will result in an UnhandledPromiseRejectionWarning. Because that is
|
||||
* a warning, the error will be effectively swallowed and execution will
|
||||
* continue */
|
||||
process.nextTick(() => {
|
||||
this.emit('status', status);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,8 @@ describe('CallStream', () => {
|
|||
reject(e);
|
||||
}
|
||||
});
|
||||
http2Stream.emit('close', Number(key));
|
||||
http2Stream.rstCode = Number(key);
|
||||
http2Stream.emit('close');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue