kopia lustrzana https://gitlab.com/gerbolyze/gerbonara
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.merge-requests/4/head
rodzic
edaf246b9d
commit
885ce36fd3
|
@ -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
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue