pytest-dev / pytest-dev/pytest-qt
High memory usage - Suspected cleanup not done per testcase
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 455
- Forks
- 72
- Avg merge
- 12h 26m
- Merged PRs (30d)
- 1
Description
For testing our application, Loadouts for Genshin Impact, we see a very high memory usage of up to 4.0 GiB even when the actual run of the application takes somewhere in the neighbourhood of 200 MiB of memory. This starts from a meagre 100 MiB and with the run of each testcase associated with pytest-qt, it adds around 100 MiB of memory which doesn't get offloaded until the end of the entire test run. We currently have around 842 tests out of which around half are associated with pytest-qt. Ideally, if the cleanups were done per testcase, we expect the run to stay well under 500 MiB of memory usage.
Here's what the conftest module looks like where our fixture is located.
import pytest
from gi_loadouts.face.wind.main import MainWindow
@pytest.fixture
def runner(qtbot):
testwind = MainWindow()
qtbot.addWidget(testwind)
return testwind
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked test/conftest.py fixture and reproduce the memory growth using the pytest-qt tests in the linked Loadouts for Genshin Impact project. Trace how qtbot.addWidget(testwind) handles cleanup between testcases and compare memory usage across the run. Done means the reported per-testcase growth is resolved or its cause is identified with a focused regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100