Comments (7)
Hello @csheaff
Thanks for reporting. It is a bit weird to me as I do not play at all with capture fixtures nor the way pytest handles logs and prints.
I might be hard to analyze and debug but I'll try to have a look this week prior to the upcoming release of pytest-monitor.
from pytest-monitor.
After some investigations, I think the problem is related to memory_profiler.
The following example illustrates the problem you are experiencing:
import memory_profiler
def foo():
print('Hello World')
if __name__ == '__main__':
print(memory_profiler.memory_usage((foo, ()), max_usage=True, retval=True))
This prints the following on my machine:
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
(25.5625, None)
If I remove the memory profiling part from the plugin, the output is as expected. I'll ask for some support to memory_profiler.
Edit: pythonprofilers/memory_profiler#298
from pytest-monitor.
I understand. I'll prioritize the investigation.
from pytest-monitor.
I might have found a workaround. memory_profiler collects datas from a dedicated process. For fast enough functions, it repeats the process until (in our case) 4 measures have been done.
I have constrained the collect to perform 1 iteration only but I have no clue regarding eventual impacts on the collected measures.
I will need to compare with previous run on some repos. I'll check that this week.
from pytest-monitor.
Ill just add that it is not only printing that is repeated, the test function actually executed multiple times. This can cause test-failure.
using pytest 6.1
, pytest-monitor 1.4
.
from pytest-monitor.
Hi @tobni
This is critical indeed. AFAIK, pytest-monitor is not showing up such behavior with previous versions of pytest. I did run it with a set of 7000+ tests and the ELA time remains constant. I'll need to get some time to dive deep into this issue.
May I suggest for now to use pytest 5.X series? Or is this something you can't consider for any reason?
from pytest-monitor.
Downgrading works for my own testing of parts of a test suite, sure, but it is not an option for CI etc. I was hoping pytest-monitor
would grant real insight/value in a CI setting.
from pytest-monitor.
Related Issues (20)
- add support for unittests (via pytest) HOT 9
- Provide an option to force garbage collector to run between tests HOT 2
- discuss best memory measurement approach and possible leak detection
- Backend realization HOT 2
- Unable to send measures on monitor-server
- Write monitor-output of tests to console HOT 6
- Incorrect result HOT 6
- pytest.skip() in a fixture causes an AttributeError for monitor_results during teardown HOT 5
- creating/binding a socket in a fixture causes it to not close HOT 6
- unicode issue in determine_scm_revision with Perforce
- Crash on __init__ if psutil.cpu_freq() gives no results HOT 1
- Running pytest after install pytest-monitor results in `FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ))` HOT 6
- NotImplementedError: can't find current frequency file HOT 4
- Support for newer python versions HOT 1
- Missing metrics for failed tests HOT 8
- Drop python 3.7/pytest 5.*
- Use black and flake8 with pre-commit hooks
- Add Bitbucket CI details to
- Add postgres DB handler
- --no-monitor breaks pytest.raises and django_assert_num_queries HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-monitor.