question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytest leaks memory and crashes jenkins slaves when this error occurs

See original GitHub issue

Hi team, unfortunately I don’t have exact steps to recreate this, but I will include as much information as I have at this point and build upon it.

pytest version: 5.2.1

[gw11] linux Python 3.7.5 cwd: /home/jenkins/workspace/branch/rootdir
18:16:25  /home/jenkins/workspace/branch/rootdir/venv/lib/python3.7/site-packages/_pytest/pathlib.py:47: PytestWarning: (rm_rf) error removing /home/jenkins/workspace/branch/rootdir/.pytest_cache/v: [Errno 2] No such file or directory: 'v'
18:16:25    PytestWarning("(rm_rf) error removing {}: {}".format(path, excvalue))
18:16:25  /home/jenkins/workspace/branch/rootdir/venv/lib/python3.7/site-packages/_pytest/pathlib.py:47: PytestWarning: (rm_rf) error removing /home/jenkins/workspace/branch/rootdir/.pytest_cache/.gitignore: [Errno 2] No such file or directory: '.gitignore'
18:16:25    PytestWarning("(rm_rf) error removing {}: {}".format(path, excvalue))
18:16:34  collected 1947 items / 987 deselected / 960 selected

Not sure if this is caused by xdist? not sure if its also one of our plugins (internally loaded) but it looks like core pytest code here. Weird that it is looking for .gitignore etc to try and rm?

I will update this ticket as more information comes to light, sorry for lack of information, it happens perhaps 1 in 30 runs on jenkins.

When the above occurs, memory on the jenkins slave is consumed and consumed eventually reaching 100% and destroying the node, leaving the build hanging indefinitely

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
blueyedcommented, Feb 4, 2020

@symonk It was addressed / improved in https://github.com/pytest-dev/pytest/commit/172b82875a2c3c1052938a300bc97d8cfb9688ab, but looks more like a red herring, i.e. it might indicate that something wrong is going on, but do not expect this to cause a hang - but maybe xdist gets confused through it somehow…?

As for clearing the cache you could also just try not using the option, but rm -rf … manually, and the see if it helps / works around this.

0reactions
symonkcommented, Feb 4, 2020

thanks, i dont think its too crazy - it is primarily integration and full end2end system testing that can take into the minutes for 1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leak in remoting causes Jenkins to crash
I've upgraded the 'Pipeline: API' plugin from version 2.32 to 2.33. Usually the server crashes within 24 hours of its last restart, I...
Read more >
allure-framework/allure-core - Gitter
Hey guys has anyone faced an issue where the Jenkins slave goes offline while archiving allure-report.zip? here is some error log /code.
Read more >
Changelog — pytest documentation
issue #7814: Fixed crash in header reporting when testpaths is used and ... Fix memory leak where objects returned by fixtures were never...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
(was: =dev-java/jdbm-1.0 is available)" status:RESOLVED ... doc on amd64 due to out of memory error" status:RESOLVED resolution:OBSOLETE severity:normal ...
Read more >
Testing framework — Manual - NS-3
If a failure is detected in one of the automated build and test jobs, ... 3 skipped, 1 failed, 0 crashed, 0 valgrind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found