Skip to content
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

Improve test_http_input execution speed #720

Merged
merged 13 commits into from
Dec 6, 2024

Conversation

dtrai2
Copy link
Collaborator

@dtrai2 dtrai2 commented Dec 5, 2024

you can check with:

pytest tests/unit/connector/test_http_input.py -vv --durations=10 --durations-min=1.0

main:
image

this branch:
image

we have two test files with the same name, that as an influence on test collection in pycharm. This is an easy workaround.
@dtrai2 dtrai2 added the enhancement New feature or request label Dec 5, 2024
@dtrai2 dtrai2 self-assigned this Dec 5, 2024
dtrai2 added 10 commits December 6, 2024 10:03
- updated test cases to use direct `get` and `post` methods instead of `simulate_get` and `simulate_post`.
- improves the clarity of the test code and aligns with the updated API usage.
- generalizes implementation
- doing 90 instead of 100 loop repetitions decreases test from 4 seconds down to 33 milliseconds
- test if the http_input mock has a side effect on the domain_resolver test
@dtrai2 dtrai2 requested a review from ekneg54 December 6, 2024 14:45
@dtrai2 dtrai2 marked this pull request as ready for review December 6, 2024 14:46
Copy link
Collaborator

@ekneg54 ekneg54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. I will keep you in my prayers. 👍

@ekneg54 ekneg54 merged commit 96f9a26 into main Dec 6, 2024
13 checks passed
@ekneg54 ekneg54 deleted the dev-improve-http-input-test-speed branch December 6, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants