summaryrefslogtreecommitdiff
path: root/tests/topotests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/conftest.py')
-rwxr-xr-xtests/topotests/conftest.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py
index 44536e945e..dafd19c283 100755
--- a/tests/topotests/conftest.py
+++ b/tests/topotests/conftest.py
@@ -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
# ---------------------------------------------------