cherry-pick(#30135): chore: do not exit UI mode upon page reload

This commit is contained in:
Pavel Feldman 2024-03-26 15:49:44 -07:00
parent 757f308475
commit 75776dbc3e
2 changed files with 2 additions and 2 deletions

View file

@ -229,7 +229,6 @@ class StdinServer implements Transport {
}
onclose() {
gracefullyProcessExitDoNotHang(0);
}
sendEvent?: (method: string, params: any) => void;

View file

@ -98,7 +98,7 @@ class TestServerDispatcher implements TestServerInterface {
this._configFile = configFile;
this.transport = {
dispatch: (method, params) => (this as any)[method](params),
onclose: () => gracefullyProcessExitDoNotHang(0),
onclose: () => {},
};
this._globalWatcher = new Watcher('deep', () => this._dispatchEvent('listChanged', {}));
this._testWatcher = new Watcher('flat', events => {
@ -392,6 +392,7 @@ async function innerRunTestServer(configFile: string | undefined, options: { hos
const testServer = new TestServer(configFile);
const cancelPromise = new ManualPromise<void>();
const sigintWatcher = new SigIntWatcher();
process.stdin.on('close', () => gracefullyProcessExitDoNotHang(0));
void sigintWatcher.promise().then(() => cancelPromise.resolve());
try {
const server = await testServer.start(options);