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

save certificate for use in tests #13750

Closed
wants to merge 2 commits into from
Closed

save certificate for use in tests #13750

wants to merge 2 commits into from

Conversation

dholth
Copy link
Contributor

@dholth dholth commented Apr 1, 2024

Description

An attempt to speed up the tests by not creating a new certificate all the time.

To address codspeed regressions in #13735

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@dholth dholth requested a review from a team as a code owner April 1, 2024 21:03
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 1, 2024
@kenodegard
Copy link
Contributor

you can also update the test to isolate the code to benchmark versus the setup/teardown:

@pytest.mark.benchmark
def test(benchmark):
    # setup

    @benchmark
    def _():
        # code to benchmark

    # teardown

Copy link

codspeed-hq bot commented Apr 1, 2024

CodSpeed Performance Report

Merging #13750 will degrade performances by 66.66%

Comparing httpserver-certificate (9578137) with main (11c21d5)

Summary

❌ 2 regressions
✅ 19 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main httpserver-certificate Change
test_jlap_fetch_ssl[False] 359.9 ms 936.8 ms -61.58%
test_jlap_fetch_ssl[True] 619.1 ms 1,856.9 ms -66.66%

@dholth
Copy link
Contributor Author

dholth commented Apr 1, 2024

Sounds good, looking at those functions that happened to be tagged as benchmark, a lot of what it's doing is test setup.
It would make more sense to benchmark single functions like fetch.download_and_hash or repo.repodata(). Will also have to consider whether those would mess with the "count function calls with a mocker" part of the test.

Copy link
Member

Choose a reason for hiding this comment

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

Couldn't we just depend on Werkzeug in the tests? Aren't we already using flask in the tests?


### Other

* Use static ssl certificate in test suite to save time (#13750)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Use static ssl certificate in test suite to save time (#13750)
* Use static ssl certificate in test suite to save time. (#13750)

@dholth
Copy link
Contributor Author

dholth commented Apr 24, 2024

It looks like this doesn't speed up the tests as hoped.

@dholth dholth closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants