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