-
Notifications
You must be signed in to change notification settings - Fork 27
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
♻️ fixes flaky test_time_overhead_on_handlers_of_auth_decorators #5279
Merged
pcrespov
merged 2 commits into
ITISFoundation:master
from
pcrespov:fix/flaky-test-login
Jan 31, 2024
Merged
♻️ fixes flaky test_time_overhead_on_handlers_of_auth_decorators #5279
pcrespov
merged 2 commits into
ITISFoundation:master
from
pcrespov:fix/flaky-test-login
Jan 31, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5279 +/- ##
=========================================
- Coverage 87.3% 76.8% -10.5%
=========================================
Files 1316 542 -774
Lines 53813 27142 -26671
Branches 1170 202 -968
=========================================
- Hits 46988 20857 -26131
+ Misses 6576 6235 -341
+ Partials 249 50 -199
Flags with carried forward coverage won't be shown. Click here to find out more. |
39da5e0
to
35351ee
Compare
|
sanderegg
approved these changes
Jan 31, 2024
matusdrobuliak66
approved these changes
Jan 31, 2024
GitHK
approved these changes
Jan 31, 2024
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What do these changes do?
test_time_overhead_on_handlers_of_auth_decorators
would run sequentially two requests (w/ and w/o auth) and compare their times to make sure the overhead ofauth_decorators
was bound.@sanderegg correctly pointed out that this test was not well defined since in the CI multiple tests are run in parallel and we cannot control how busy the machines are . Therefore even if in the original test we do a relative comparison, we cannot guarantee that each of the individual runs were done in "equivalent" conditions.
To resolve this issue, this test has been refactored to run multiple times each request and compute use the median of each of the runs do the comparison ( Note that the mean is strongly affected by outliers and is not necessarily a typical example of the data points. For a more robust, although less efficient, measure of central tendency we use media. Quote from 1)
NOTE: I also tried to use pytest-benchmark to do this test I had many troubles with the event loop (benchrmark needs a sync callable) and also was not clear to me how to compare the two different runs.
Related issue/s
How to test
Two driving tests:
test_number_of_db_calls_on_handlers_of_auth_decorators
ensures max. number of calls to the db from decoratorstest_time_overhead_on_handlers_of_auth_decorators
benchmarks class w/ and w/o authz and compares time overhead.Dev Checklist
DevOps
None