fix(test-e2e-playwright): run Playwright without core dumps

Main run 45509759037 Moodle#2: after six chrome-headless int3 traps the Playwright container ran out of space ('OSError: [Errno 28] No space left on device', every file of the inner snapshot 0 bytes), while the host filesystem was back at 52 % once the container was gone. The host kernel uses a relative file core_pattern (no pipe helper), so crashing browsers can write core files into the container's filesystem. The runner now starts with --ulimit=core=0, the container guard allows exactly that value, and the local rerun script and the README carry the same flag. No artifact shows a core file itself, so this is the likely cause; draft PR, CI proves it.

🎯 Fix: 75 %
💥 Break: 3 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 73
🚦 Gate: ⛔ fix 75 % < 90

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-25 11:44:33 +00:00
1 parent 042eeae5b3
commit dfea2e32cc
6 files changed
+22 -3

No files matched your search

@@ -148,6 +148,8 @@ def argv_triggers(stage: Path, run: Path) -> dict[str, tuple[str, list[str]]]:
),
"entrypoint": ("-w", ["--entrypoint", "/bin/sh", "-w"]),
"privileged": ("-w", ["--privileged", "-w"]),
"core_dumps": ("-w", ["--ulimit=core=-1", "-w"]),
"other_ulimit": ("-w", ["--ulimit", "nofile=1048576", "-w"]),
"other_cidfile": (f"--cidfile={run}/.cid", ["--cidfile=/srv/x/.cid"]),
"no_log_driver": ("--log-driver=none", []),
"reports_elsewhere": (f"{run}/reports:/reports", ["/srv/x:/reports"]),
@@ -212,6 +214,12 @@ class TestSpecSecretsContainer(unittest.TestCase):
def test_the_command_a_run_with_spec_secrets_starts_passes(self) -> None:
self.assertFalse(self.refused(container_argv(self.root, self.run_dir)))
def test_a_run_without_core_dumps_passes(self) -> None:
argv = container_argv(self.root, self.run_dir)
at = argv.index("-w")
argv[at:at] = ["--ulimit=core=0"]
self.assertFalse(self.refused(argv))
def test_a_docker_config_the_caller_exports_stays_out_of_the_checks(self) -> None:
argv = container_argv(self.root, self.run_dir)
exported = {"DOCKER_CONFIG": str(open_config(self.root))}
@@ -3,6 +3,7 @@ from __future__ import annotations
import copy
import re
import unittest
from itertools import pairwise
from . import role_task
from ._spec_secrets_wiring import (
@@ -27,6 +28,7 @@ from ._spec_secrets_wiring import (
mount_violations,
prune_violations,
render,
render_argv,
role_tasks,
run_argv,
)
@@ -313,6 +315,14 @@ class TestSpecSecretsMount(unittest.TestCase):
queued = role_task("03_run_pass.yml", "📬")["vars"]["_playwright_argv"]
self.assertEqual(queued, run_argv())
def test_every_run_disables_core_dumps_in_the_container(self) -> None:
for exists, directory in ((False, STALE_DIR), (True, SECRETS_DIR)):
with self.subTest(template=exists):
argv = render_argv(run_argv(), exists, directory)
self.assertIn(
("--shm-size=1g", "--ulimit=core=0"), list(pairwise(argv))
)
def test_the_role_level_env_file_is_untouched(self) -> None:
self.assertEqual(env_task()["ansible.builtin.copy"]["mode"], "0644")
self.assertNotIn("secrets", str(env_task()))