playwright
Advanced tools
Comparing version 1.50.0-alpha-2025-01-03 to 1.50.0-alpha-2025-01-04
@@ -81,3 +81,3 @@ "use strict"; | ||
launchedProcess, | ||
kill | ||
gracefullyClose | ||
} = await (0, _utils.launchProcess)({ | ||
@@ -93,5 +93,21 @@ command: this._options.command, | ||
shell: true, | ||
// Reject to indicate that we cannot close the web server gracefully | ||
// and should fallback to non-graceful shutdown. | ||
attemptToGracefullyClose: () => Promise.reject(), | ||
attemptToGracefullyClose: async () => { | ||
if (process.platform === 'win32') throw new Error('Graceful shutdown is not supported on Windows'); | ||
if (!this._options.gracefulShutdown) throw new Error('skip graceful shutdown'); | ||
const { | ||
signal, | ||
timeout = 0 | ||
} = this._options.gracefulShutdown; | ||
// proper usage of SIGINT is to send it to the entire process group, see https://www.cons.org/cracauer/sigint.html | ||
// there's no such convention for SIGTERM, so we decide what we want. signaling the process group for consistency. | ||
process.kill(-launchedProcess.pid, signal); | ||
return new Promise((resolve, reject) => { | ||
const timer = timeout !== 0 ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout`)), timeout) : undefined; | ||
launchedProcess.once('close', (...args) => { | ||
clearTimeout(timer); | ||
resolve(); | ||
}); | ||
}); | ||
}, | ||
log: () => {}, | ||
@@ -101,3 +117,3 @@ onExit: code => processExitedReject(new Error(code ? `Process from config.webServer was not able to start. Exit code: ${code}` : 'Process from config.webServer exited early.')), | ||
}); | ||
this._killProcess = kill; | ||
this._killProcess = gracefullyClose; | ||
debugWebServer(`Process started`); | ||
@@ -104,0 +120,0 @@ launchedProcess.stderr.on('data', data => { |
{ | ||
"name": "playwright", | ||
"version": "1.50.0-alpha-2025-01-03", | ||
"version": "1.50.0-alpha-2025-01-04", | ||
"description": "A high-level API to automate web browsers", | ||
@@ -59,3 +59,3 @@ "repository": { | ||
"dependencies": { | ||
"playwright-core": "1.50.0-alpha-2025-01-03" | ||
"playwright-core": "1.50.0-alpha-2025-01-04" | ||
}, | ||
@@ -62,0 +62,0 @@ "optionalDependencies": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3171538
36212
+ Addedplaywright-core@1.50.0-alpha-2025-01-04(transitive)
- Removedplaywright-core@1.50.0-alpha-2025-01-03(transitive)