Skip to content

Commit

Permalink
Merge pull request #17296 from LabNConsulting/liambrady/core-rlimit-r…
Browse files Browse the repository at this point in the history
…espect-hard-limit

tests: respect RLIMIT_CORE hard limit
  • Loading branch information
ton31337 authored Oct 31, 2024
2 parents 7c10340 + b4dc01b commit 5f11235
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/topotests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,14 @@ def pytest_configure(config):
is_xdist = True
is_worker = True

resource.setrlimit(
resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)
)
try:
resource.setrlimit(
resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)
)
except ValueError:
# The hard limit cannot be raised. Raise the soft limit to previous hard limit
core_rlimits = resource.getrlimit(resource.RLIMIT_CORE)
resource.setrlimit(resource.RLIMIT_CORE, (core_rlimits[1], core_rlimits[1]))
# -----------------------------------------------------
# Set some defaults for the pytest.ini [pytest] section
# ---------------------------------------------------
Expand Down

0 comments on commit 5f11235

Please sign in to comment.