From 05e81625a9074c10d1b04a1e5ae3a02b6ff20342 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Mon, 2 Nov 2026 17:14:40 +0100 Subject: [PATCH] ci: raise the open-file limit for mongod in the agent integration job The first run of the job lost mongod mid-run again: its log says "Too many open files" (WiredTiger fatal assertion). Every test opens its own database, so WiredTiger keeps a file open per collection and index, and job containers start with a soft limit of 1024. Reproduced locally with --ulimit nofile=1024:524288 (19 of 87 failed); with 64000, all 87 pass. That also explains the lost mongo service containers in #584. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4c23863..ab228bd 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -152,11 +152,11 @@ jobs: if: always() # compliance-agent's integration tests (compliance-agent/tests) need MongoDB. - # mongod runs as a process inside this job container, not as a `services:` - # container: three tries with a mongo service lost the database mid-run - # (pruefwerk #584), while the same tests against a mongo capped like a job - # (3 GB, 2 CPUs) pass locally and peak at ~0.5 GB. A process here can't be - # removed by the runner, and its log is printed when a test fails. + # Every test opens its own database, so WiredTiger keeps a file open per + # collection and index: with the containers' default of 1024 open files + # mongod aborts mid-run ("Too many open files"), which is what took the + # mongo service down in #584. mongod runs as a process in this job + # container with a raised limit, and its log is printed when a test fails. agent-integration: name: Agent integration if: github.event_name == 'pull_request' @@ -213,6 +213,8 @@ jobs: echo "${MONGODB_SHA256} /tmp/mongodb.tgz" | sha256sum -c - tar -xzf /tmp/mongodb.tgz -C /opt mkdir -p /tmp/mongo-db + ulimit -n 64000 2>/dev/null || ulimit -n "$(ulimit -Hn)" + echo "open files: soft $(ulimit -Sn), hard $(ulimit -Hn)" "/opt/${T}/bin/mongod" --dbpath /tmp/mongo-db --bind_ip 127.0.0.1 --port 27017 \ --wiredTigerCacheSizeGB 0.25 --fork --logpath /tmp/mongod.log for i in $(seq 1 30); do