Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(rpc): exit server upon pipe disconnect (#2836)

Pavel Feldman241d39f90459
diff --git a/src/rpc/transport.ts b/src/rpc/transport.ts
index 1835d1d111..cf1ec92682 100644
--- a/src/rpc/transport.ts
+++ b/src/rpc/transport.ts
@@ -29,6 +29,7 @@ export class Transport {
constructor(pipeWrite: NodeJS.WritableStream, pipeRead: NodeJS.ReadableStream) {
this._pipeWrite = pipeWrite;
pipeRead.on('data', buffer => this._dispatch(buffer));
+ pipeRead.on('close', () => process.exit(0));
this.onmessage = undefined;
this.onclose = undefined;
}