Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix(dashboard): close server in singleton handler on shutdown (#40626)
Simon Knottf536e37aa208
diff --git a/packages/playwright-core/src/tools/dashboard/dashboardApp.ts b/packages/playwright-core/src/tools/dashboard/dashboardApp.tsindex 5a0634513e..0673df147a 100644--- a/packages/playwright-core/src/tools/dashboard/dashboardApp.ts+++ b/packages/playwright-core/src/tools/dashboard/dashboardApp.ts@@ -280,7 +280,9 @@ async function acquireSingleton(options: DashboardOptions): Promise<net.Server>const server = net.createServer();server.listen(socketPath, () => resolve(server));server.on('error', (err: NodeJS.ErrnoException) => {- if (err.code !== 'EADDRINUSE')+ const isInUse = err.code === 'EADDRINUSE'+ || (process.platform === 'win32' && err.code === 'EBUSY');+ if (!isInUse)return reject(err);const client = net.connect(socketPath, () => {client.write(JSON.stringify(options) + '\n');@@ -350,6 +352,7 @@ export async function openDashboardApp() {dashboard.triggerAnnotate();dashboard.registerAnnotateWaiter(socket);} else if (parsed.kill) {+ server?.close();socket.end();gracefullyProcessExitDoNotHang(0);} else {