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

Optimize e2e tests by parallelizing work in EnsureCleanState #20968

Closed
andrii-korotkov-verkada opened this issue Nov 27, 2024 · 1 comment · Fixed by #20998
Closed

Optimize e2e tests by parallelizing work in EnsureCleanState #20968

andrii-korotkov-verkada opened this issue Nov 27, 2024 · 1 comment · Fixed by #20998
Assignees
Labels
component:test Test requests (e2e or unit) enhancement New feature or request

Comments

@andrii-korotkov-verkada
Copy link
Contributor

Summary

There can be steps to be executed in parallel (a naive assumption could be that nearly all steps can be) to save time.

Motivation

EnsureCleanState is ~10-30% of each e2e test run time, so optimizing it can substantially reduce the overall e2e tests run time.

Proposal

Figure out which blocks are safe to execute in parallel and do so.

@andrii-korotkov-verkada andrii-korotkov-verkada added enhancement New feature or request component:test Test requests (e2e or unit) labels Nov 27, 2024
@andrii-korotkov-verkada
Copy link
Contributor Author

Will do after #20942 and #20939 are merged.

andrii-korotkov-verkada added a commit to andrii-korotkov-verkada/argo-cd that referenced this issue Nov 29, 2024
…rmation

Closes argoproj#20968
Closes argoproj#20967

A number of cleanup and create steps can be done in parallel, reducing the total runtime. Gather timing information as well and log it.

Signed-off-by: Andrii Korotkov <[email protected]>
adriananeci pushed a commit to adriananeci/argo-cd that referenced this issue Dec 4, 2024
…rmation (argoproj#20998)

* chore: Parallelize EnsureCleanState for e2e tests, adding timing information

Closes argoproj#20968
Closes argoproj#20967

A number of cleanup and create steps can be done in parallel, reducing the total runtime. Gather timing information as well and log it.

Signed-off-by: Andrii Korotkov <[email protected]>

* Add underscores to function map keys

Signed-off-by: Andrii Korotkov <[email protected]>

* Have separate log statements for timing fields, since everything doesn't fit in Github logs and gets truncated

Signed-off-by: Andrii Korotkov <[email protected]>

* Re-run tests

Signed-off-by: Andrii Korotkov <[email protected]>

* Fix duplicate removal attempts, cleanup things in namespaces before removing namespaces

Signed-off-by: Andrii Korotkov <[email protected]>

* Combine config map cleanups, since they seem to have some kind of locking based on timings

Signed-off-by: Andrii Korotkov <[email protected]>

* Re-order some cleanups to not wait if something is already covered by no wait commands

Signed-off-by: Andrii Korotkov <[email protected]>

* Move rm temp dir to be together with re-creation, since otherwise repo server watcher seems to fail

Signed-off-by: Andrii Korotkov <[email protected]>

* Only update config maps and login as admin if there were any changes

Signed-off-by: Andrii Korotkov <[email protected]>

* Also check for user being logged in

Signed-off-by: Andrii Korotkov <[email protected]>

* Improve config maps equivalency check

Signed-off-by: Andrii Korotkov <[email protected]>

* Remove timing information

Signed-off-by: Andrii Korotkov <[email protected]>

* Improve loops with sleep

Signed-off-by: Andrii Korotkov <[email protected]>

* Properly propagate and handle errors for parallel functions

Signed-off-by: Andrii Korotkov <[email protected]>

* Add missing CheckError

Signed-off-by: Andrii Korotkov <[email protected]>

* Fix import

Signed-off-by: Andrii Korotkov <[email protected]>

* Fix imports linter error (try 2)

Signed-off-by: Andrii Korotkov <[email protected]>

* Parallelize EnsureCleanState for application sets

Signed-off-by: Andrii Korotkov <[email protected]>

* Fix errors.IsNotFound

Signed-off-by: Andrii Korotkov <[email protected]>

* Use errgroup to run functions in parallel

Signed-off-by: Andrii Korotkov <[email protected]>

* Remove name keys for functions as unused

Signed-off-by: Andrii Korotkov <[email protected]>

* Use apierr directly

Signed-off-by: Andrii Korotkov <[email protected]>

---------

Signed-off-by: Andrii Korotkov <[email protected]>
Signed-off-by: Adrian Aneci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:test Test requests (e2e or unit) enhancement New feature or request
Projects
None yet
1 participant