From 5fa2f62536c0447dda77c7d4f400a82d03c62a3e Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sat, 19 Jul 2025 11:14:37 -0700 Subject: [PATCH] test_driver: increase open file limit Prevent failures due to file handle exhaustion. --- tests/test_driver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_driver.py b/tests/test_driver.py index 0a223fcc5..13ec7288c 100755 --- a/tests/test_driver.py +++ b/tests/test_driver.py @@ -4,6 +4,7 @@ import asyncio from datetime import datetime import os from pathlib import Path +import resource import shutil import subprocess import sys @@ -365,6 +366,11 @@ else: asyncio_run = asyncio.run if __name__ == "__main__": + # Increase the maximum number of open files to at least 4096, + # as we run tests concurrently. + soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE) + if soft < 4096: + resource.setrlimit(resource.RLIMIT_NOFILE, (min(4096, hard), hard)) try: ret = asyncio_run(main()) sys.exit(ret)