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(cli): don't garbage-collect browsers during CLI daemon install (#41553)
Pavel Feldman07b5acd9e4cf
diff --git a/packages/playwright-core/src/server/registry/index.ts b/packages/playwright-core/src/server/registry/index.tsindex 55b59d722f..6cd606894e 100644--- a/packages/playwright-core/src/server/registry/index.ts+++ b/packages/playwright-core/src/server/registry/index.ts@@ -1101,7 +1101,7 @@ export class Registry {return await installDependenciesLinux(targets, dryRun);}- async install(executablesToInstall: Executable[], options?: { force?: boolean }) {+ async install(executablesToInstall: Executable[], options?: { force?: boolean, gc?: boolean }) {const executables = this._dedupe(executablesToInstall);await fs.promises.mkdir(registryDirectory, { recursive: true });const lockfilePath = path.join(registryDirectory, '__dirlock');@@ -1127,7 +1127,7 @@ export class Registry {await fs.promises.writeFile(path.join(linksDir, calculateSha1(PACKAGE_PATH)), PACKAGE_PATH);// Remove stale browsers.- if (!getAsBooleanFromENV('PLAYWRIGHT_SKIP_BROWSER_GC'))+ if (options?.gc !== false && !getAsBooleanFromENV('PLAYWRIGHT_SKIP_BROWSER_GC'))await this._validateInstallationCache(linksDir);// Install browsers for this package.diff --git a/packages/playwright-core/src/tools/cli-daemon/program.ts b/packages/playwright-core/src/tools/cli-daemon/program.tsindex 1d8877330b..fdb3e7a05a 100644--- a/packages/playwright-core/src/tools/cli-daemon/program.ts+++ b/packages/playwright-core/src/tools/cli-daemon/program.ts@@ -139,7 +139,7 @@ async function findOrInstallDefaultBrowser() {async function resolveAndInstall(nameOrChannel: string) {const executables = browserRegistry.resolveBrowsers([nameOrChannel], { shell: 'no' });- await browserRegistry.install(executables);+ await browserRegistry.install(executables, { gc: false });}async function createDefaultConfig(channel: string) {