The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
runner: drop the RLIMIT_DATA worker cap
teknium16159bf4d87a3
diff --git a/AGENTS.md b/AGENTS.mdindex 3ea098b15e2..1a9edd8af82 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -341,8 +341,7 @@ scripts/run_tests.sh -v --tb=long # pytest flags pass thro- **Flake policy:** a failing FILE is retried once in a fresh subprocess (`--file-retries`;`HERMES_TEST_FILE_RETRIES=0` disables); a worker killed by signal or the file timeout is never- retried. Each worker runs under an 8 GiB heap cap on Linux (`HERMES_TEST_WORKER_MEM_GB`, 0- disables) so a runaway loop dies with a `MemoryError` traceback instead of swapping the host. Pass-on-retry is green but printed under `⚠ FLAKY`+ retried (relaunching a runaway doubles the damage). Pass-on-retry is green but printed under `⚠ FLAKY`with both outputs — a bug to fix, not noise. Timing tests must not assume a quiet runner:wall-clock bounds ≥ 2s, event-based sync, no `assert not _wait_until(...)` races.- **Placement mirrors the source tree.** A test lives in `tests/<top-level source dir>/` (`tests/hermes_cli/`,diff --git a/scripts/run_tests.sh b/scripts/run_tests.shindex d2e9aedb495..77eedc6d1cc 100755--- a/scripts/run_tests.sh+++ b/scripts/run_tests.sh@@ -143,7 +143,7 @@ done# credential can leak" property stays auditable at a glance.TEST_ENV=()for _test_var in HERMES_TEST_IMAGE HERMES_TEST_WORKERS HERMES_TEST_PATHS \- HERMES_TEST_FILE_TIMEOUT HERMES_TEST_FILE_RETRIES HERMES_TEST_WORKER_MEM_GB HERMES_TEST_SLICE; do+ HERMES_TEST_FILE_TIMEOUT HERMES_TEST_FILE_RETRIES HERMES_TEST_SLICE; doif [ -n "${!_test_var:-}" ]; thenTEST_ENV+=("$_test_var=${!_test_var}")fidiff --git a/scripts/run_tests_parallel.py b/scripts/run_tests_parallel.pyindex 5acf053d6b5..9f7622daaf7 100755--- a/scripts/run_tests_parallel.py+++ b/scripts/run_tests_parallel.py@@ -117,13 +117,6 @@ _DEFAULT_FILE_TIMEOUT_SECONDS = 300.0# Set to 0 to disable (env: HERMES_TEST_FILE_RETRIES)._DEFAULT_FILE_RETRIES = 1-# Per-worker heap cap in GiB (Linux RLIMIT_DATA: brk + private anonymous mmap; inherited by the-# worker's children). A runaway allocation loop then dies with a MemoryError traceback in seconds-# instead of swapping the host for 20 GB with no stack (five OOM incidents from one leaking test-# thread). RLIMIT_AS is deliberately NOT used: browsers spawned by tests reserve huge address-# space. Set to 0 to disable (env: HERMES_TEST_WORKER_MEM_GB).-_DEFAULT_WORKER_MEM_GB = 8.0-# Duration cache: maps relative file paths to last-observed subprocess# wall-clock seconds. Used by ``--slice`` to distribute files across# CI jobs by estimated total time, so no one job gets all the slow files.@@ -452,25 +445,6 @@ _FLAKY_RESULTS: List[Tuple[Path, str]] = []_flaky_lock = threading.Lock()-def _worker_memory_cap():- """``preexec_fn`` applying the per-worker heap cap, or None when disabled / unsupported."""- if sys.platform != "linux":- return None- try:- gib = float(os.environ.get("HERMES_TEST_WORKER_MEM_GB", _DEFAULT_WORKER_MEM_GB))- except ValueError:- gib = _DEFAULT_WORKER_MEM_GB- if gib <= 0:- return None- limit = int(gib * (1 << 30))-- def _apply():- import resource- resource.setrlimit(resource.RLIMIT_DATA, (limit, limit))-- return _apply--def _run_one_file_once(file: Path,pytest_args: List[str],@@ -512,7 +486,6 @@ def _run_one_file_once(stderr=subprocess.STDOUT,text=True, encoding="utf-8", errors="replace",env=env,- preexec_fn=_worker_memory_cap(),# POSIX: place the child at the head of its own process group so# _kill_tree can SIGKILL the group atomically.# Windows: this maps to CREATE_NEW_PROCESS_GROUP in CPython 3.12+;