-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(79): Ensure tests supposed to fail also fail, when monitoring is disabled (--no-monitor cmd flag) #81
base: master
Are you sure you want to change the base?
Conversation
disabled (--no-monitor cmd flag) changelog updated in this commit too The issue was an exception not being raised when calling wrapped_function when monitoring is disabled in line 216. The raise is being handled now in the following lines 218ff.
Quality Gate failedFailed conditions |
I'm not sure what SonarClouds wants to say with DuplicationOnNewCode or how I could resolve that. |
Returning exceptions inside the wrapped_function() can lead to assertions being ignored, therefore they need to be raised instantly and parent calls need to wrap their call in a try except block.
The memory profiler only reports Exceptions when it should report all Exceptions that inherit from BaseExceptions. This is ultimately reworked in a PR incorporating a simplified memory profiler module into the codebase that fixes not only this issue but also gives the possibility of getting measurements for failing tests. This workaround uses return values to work around the issue. This way pytest-monitor can check for BaseExceptions and act accordingly. Like described earlier the ultimate goal should probably be to replace the whole memory profiler as proposed in this PR: CFMTech#82
The newest commit is a bug fix introduced by the memory_profiler module, which doesn't catch all Exceptions (only checks for Exception not BaseException). Worked around this by returning the exception from the wrapped function. This is only a temporary workaround to make everything work, it should be considered to do it as in PR #82 and replace the whole memory profiler module in some way and fix the issues that way. The bug occurs on test runs and causes them to not finish but block execution from finishing. |
Description
There was a bug that resulted in some tests not failing when the cmd flag
--no-monitor
is set. Raising a BaseException in the corresponding code that runs when monitoring is disabled (line 218 following) solves the issue.Fixes #79
fix(79): Ensure test supposed to fail also fail, when monitoring is disabled (--no-monitor cmd flag)
changelog updated in this commit too
The issue was an exception not being raised when calling
wrapped_function when monitoring is disabled in line 216.
The raise is being handled now in the following lines 218ff.
Checklist:
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have added tests that prove my fix is effective or that my feature works- [] New and existing unit tests pass locally with my changes (not just the CI)- [ ] Any dependent changes have been merged and published in downstream modulescreate one !)
Status: Code Review Needed
,Business: Test Needed
orStatus: In Progress
if you are still working on the PR)