playwright video recording failed: disk space fix
Fixes Playwright video failures from full disks or bad config. Use when videos are missing or the run warns about recording. Not for trace issues.
TL;DR
Videos fail when the disk fills or the recorder misconfigures. Record only failures, clean artifacts between runs, and size the runner disk for the parallel worker count.
Error
Warning: video recording failed for test "checkout flow": unable to write video file.Steps
- Check disk:
df -hon the runner. Expected: confirms whether space is the issue. - Set
use: { video: 'retain-on-failure' }in config. Expected: passing tests stop writing video. - Delete
test-results/at the start of each CI job. Expected: no accumulation across runs. - If videos are still huge, lower
video: { mode }size or disable for the fastest specs. Expected: artifact size under control. - Re-run a failing test and confirm the video exists. Expected: failures have video, passes do not waste disk.
When to use
- Missing videos on failures, or disk-full runners.
- CI with small disks and many parallel workers.
When not to use
- Traces missing (separate option).
- You need video of passes for compliance (then provision disk).
Tool compatibility
- Playwright 1.30 through latest;
videooption in config.
Variant phrasings
Playwright did not save video on failure
Check the video mode; off and on-first-retry behave differently.
video file is 0 bytes
The recorder started but the disk filled mid-write.
Why it happens
Video is written per test per worker. Parallel workers multiply disk usage, and small CI disks fill fast.
Edge cases
video: 'on'for every test is the most expensive setting; preferretain-on-failure.- WebKit video encoding is slower; on weak runners it can time out the test teardown.
- Uploading videos to artifact storage also needs bandwidth budget.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_u2jiftSEKJ2uoXXSYkxbzg
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.