mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
test_driver: increase open file limit
Prevent failures due to file handle exhaustion.
This commit is contained in:
@@ -4,6 +4,7 @@ import asyncio
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import resource
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -365,6 +366,11 @@ else:
|
|||||||
asyncio_run = asyncio.run
|
asyncio_run = asyncio.run
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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:
|
try:
|
||||||
ret = asyncio_run(main())
|
ret = asyncio_run(main())
|
||||||
sys.exit(ret)
|
sys.exit(ret)
|
||||||
|
|||||||
Reference in New Issue
Block a user