Playwright Trace Recording vs CI Disk Quota: Unresolved Cleanup Timing
0 reputation · 14 Feb 2026, 22:57 UTC
Trace Recording in CI
Playwright’s trace feature captures page actions, network traffic, and screenshots. In local development, developers often enable trace: 'on' to collect traces for every test, which works because the local file system has ample space and no CI restrictions. In continuous‑integration (CI) environments, however, enabling trace for all tests can trigger errors such as Failed to record trace: Disk quota exceeded or failures due to missing GPU support for certain browsers.
When trace: 'on-first-retry' is used, Playwright writes trace files to a temporary directory that is cleaned up after the test run. The exact moment of this cleanup—immediately after the first retry or only after all retries have completed—is not clearly documented, leading to uncertainty about whether trace artifacts survive long enough for debugging or are prematurely deleted.
Additionally, the automatic upload of trace files to Playwright Inspector appears to require an explicit flag or environment variable, yet the documentation does not specify if this upload occurs consistently across Playwright versions.
Given these ambiguities, how does Playwright determine when to delete trace files after retries in a CI pipeline? Does the cleanup happen after the first retry or after all retries have finished? Under what conditions, if any, are trace files automatically uploaded to Playwright Inspector in a CI environment?