-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: improve test speed #560
Conversation
daa7397
to
36af57c
Compare
@hmlanigan I've tested Looking at the integration test results of PR #557 vs the integration test results of this PR, you can compare and see a large difference in the test times for LXD tests (approx. 35m vs 17m) Interestingly, the Microk8s based tests are quite quick taking 10-12 min. Finally, I agree that it's worthwhile testing real charms but these tests are testing the creation of offers and integrations, testing a Postgres charm that creates storage is imo stretching the goal of the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to update the charms for this 1 test.
Reducing the wait time when destroying an offer is a no go.
- Don't use postgres charms that require storage when running offer tests.
36af57c
to
1780628
Compare
@hmlanigan It's only 2 tests that have been updated now.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Let's merge once the tests all pass.
@hmlanigan Please take another look when you get a chance, all the tests that usually pass are passing. |
Description
This PR aims to improve the speed of several slow tests (tested using LXD, Microk8s specific tests have not been worked on). The current largest offenders are below (tests that takes >= 100s) based on running them locally on my laptop:
The offer based tests are slow because they deploy the postgres charm and the provider then waits for the application storage to be ready which takes a while. Here we can opt to use the
juju-qa-dummy-source
andjuju-qa-dummy-sink
charms since the goal is to test offers rather than the postgres charm and storage (if there is a need to test the postgres charm it would likely be better suited for a separate test).The second offender for the slow tests was the very lenient code in the client code
offers.go
which would wait up to 5m for an offer's connections to drop to 0. If the connections didn't drop to 0 within these 5 minutes, it would destroy an offer with theforce
flag set to true. I've dropped this to a more aggressive 30s.Type of change