MCPcopy
hub / github.com/microsoft/playwright / gracefullyProcessExitDoNotHang

Function gracefullyProcessExitDoNotHang

packages/utils/processLauncher.ts:58–67  ·  view source on GitHub ↗
(code: number, onExit?: () => Promise<void>)

Source from the content-addressed store, hash-verified

56}
57
58export function gracefullyProcessExitDoNotHang(code: number, onExit?: () => Promise<void>) {
59 // Force exit after 30 seconds.
60 const beforeExit = onExit ? () => onExit().catch(() => {}) : () => Promise.resolve();
61 // eslint-disable-next-line no-restricted-properties
62 const callback = () => beforeExit().then(() => process.exit(code));
63
64 setTimeout(callback, 30000);
65 // Meanwhile, try to gracefully close all browsers.
66 gracefullyCloseAll().then(callback);
67}
68
69function exitHandler() {
70 for (const kill of killSet)

Callers 15

startCliDaemonServerFunction · 0.90
decorateProgramFunction · 0.90
innerOpenDashboardAppFunction · 0.90
openDashboardAppFunction · 0.90
startAppFunction · 0.90
runAnnotateClientFunction · 0.90
onCloseFunction · 0.90
runDriverFunction · 0.90
runServerFunction · 0.90
launchContextFunction · 0.90
maybeSetupTestHooksFunction · 0.90

Calls 5

onExitFunction · 0.85
gracefullyCloseAllFunction · 0.85
catchMethod · 0.80
thenMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…