/dev/shm Full During Browser Tests in CI
Chromium-based browsers use /dev/shm for shared memory. In CI that mount is often small (64MB in containers), so a heavy test run fills it and the browser crashes.
What this error means
Browser tests fail with tab crashes, Target closed, or No space left on device referencing /dev/shm. Reducing parallelism or enlarging shm makes it pass with no test change.
shell
[ERROR] Failed to write to /dev/shm: No space left on device
Page crashed! ProtocolError: Target.activateTarget: Target closed.Common causes
The shared-memory mount is too small
Containers default /dev/shm to 64MB. Chromium can exceed that quickly with multiple tabs or large pages, exhausting the mount.
Too many parallel browser instances
Each headless browser consumes shm; running many in parallel multiplies the pressure on a small mount.
How to fix it
Enlarge /dev/shm or bypass it
Give the container more shared memory, or tell Chromium not to use it.
docker
# docker: enlarge shm
docker run --shm-size=2g my-tests
# or launch flag
chrome --disable-dev-shm-usage --no-sandboxLower browser parallelism
- Reduce the number of concurrent browser workers.
- Close pages/contexts promptly between tests.
- Run browser-heavy suites on a runner with more RAM.
How to prevent it
- Set
--shm-sizefor browser containers in CI. - Use
--disable-dev-shm-usagefor headless Chromium. - Cap browser worker concurrency to the runner size.
Related guides
CI "No space left on device" (ENOSPC) on the RunnerFix "No space left on device" (ENOSPC) in CI when the runner disk fills with caches, layers, and artifacts. H…
CI /tmp Directory Full (ENOSPC on tmpfs)Fix ENOSPC from a full /tmp in CI. Temp files or a small tmpfs filled the temp directory. How to clear it, re…
Jest Worker Ran Out of Memory in CIFix "Jest worker ran out of memory" in CI when too many workers or a leak exhausted RAM. How to lower workers…
CI Step "Killed" Exit Code 137 (OOM)Why CI steps exit with code 137 and "Killed": the OOM killer sent SIGKILL after the job exceeded runner memor…