fix(registry): evaluate defaultCacheDirectory lazily#41942
Conversation
`defaultCacheDirectory` used to be computed inside the `PLAYWRIGHT_BROWSERS_PATH` branch of `registryDirectory`, so setting that variable skipped the platform check a later refactor hoisted it into an eagerly evaluated module constant, so it now throws `Unsupported platform: <platform>` at import, before `registryDirectory` consults `PLAYWRIGHT_BROWSERS_PATH` this regressed setups that point `PLAYWRIGHT_BROWSERS_PATH` at their own browsers on platforms without a default cache directory, such as Android/Termux evaluate `defaultCacheDirectory`, `defaultRegistryDirectory`, and `baseDaemonDir` lazily so an explicit `PLAYWRIGHT_BROWSERS_PATH` is honored before any default cache directory is computed `registryDirectory` still throws eagerly when no override is set, since there is nowhere to place browsers
Test results for "MCP"2 failed 7784 passed, 1262 skipped Merge workflow run. |
Test results for "tests 1"4 flaky50213 passed, 1190 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the CI failures here. 🟢 Both failures are pre-existing flakes — the PR looks clearThe two MCP failures are known low-rate flakes on tests this PR doesn't touch. This PR only changes lazy evaluation of DetailsPre-existing flake / infra
Neither test reaches the changed code: the diff is confined to Triaged by the Playwright bot - agent run |
defaultCacheDirectoryused to be computed inside thePLAYWRIGHT_BROWSERS_PATHbranch ofregistryDirectory, so setting that variable skipped the platform check#39423 hoisted it into an eagerly evaluated module constant, so it now throws
Unsupported platform: <platform>at import, beforeregistryDirectoryconsultsPLAYWRIGHT_BROWSERS_PATHthis regressed setups that point
PLAYWRIGHT_BROWSERS_PATHat their own browsers on platforms without a default cache directory, such as Android/Termuxevaluate
defaultCacheDirectory,defaultRegistryDirectory, andbaseDaemonDirlazily so an explicitPLAYWRIGHT_BROWSERS_PATHis honored before any default cache directory is computedregistryDirectorystill throws eagerly when no override is set, since there is nowhere to place browsersfixes #41852