summaryrefslogtreecommitdiff
path: root/gerbonara/tests
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-07-18 11:33:46 +0200
committerjaseg <git@jaseg.de>2024-07-18 11:33:46 +0200
commit885ce36fd3da7f78d046ec7bbcc3d0c59bac650e (patch)
tree8d70d59beee9068c1dd629c3163f806168535218 /gerbonara/tests
parentedaf246b9dcfbb87a636d538536ae6c89f7ca956 (diff)
downloadgerbonara-885ce36fd3da7f78d046ec7bbcc3d0c59bac650e.tar.gz
gerbonara-885ce36fd3da7f78d046ec7bbcc3d0c59bac650e.tar.bz2
gerbonara-885ce36fd3da7f78d046ec7bbcc3d0c59bac650e.zip
tests: Adjust nice and oom_adj values on linux
The testsuite calls resvg, and that sometimes can use up *a lot* of memory. We adjust the test process tree's nice values and oom_adj values to make sure the test processes get killed during an OOM condition before anything else on the system.
Diffstat (limited to 'gerbonara/tests')
-rw-r--r--gerbonara/tests/conftest.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gerbonara/tests/conftest.py b/gerbonara/tests/conftest.py
index 7d4e996..25e8014 100644
--- a/gerbonara/tests/conftest.py
+++ b/gerbonara/tests/conftest.py
@@ -40,6 +40,11 @@ def pytest_sessionstart(session):
def pytest_configure(config):
+ os.nice(20)
+ # Resvg can sometimes consume a lot of memory. Make sure we don't kill the user's session.
+ if (oom_adj := Path('/proc/self/oom_adj')).is_file():
+ oom_adj.write_text('15\n')
+
if 'PYTEST_XDIST_WORKER' in os.environ: # only run this on the controller
return