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

Add more timing information about clean state preparation in e2e tests #20967

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

Comments

@andrii-korotkov-verkada
Copy link
Contributor

Summary

Right now the only reported timing info is for shell commands as well as total. The former is about 300-400ms, while the total can be 1.1-1.4sec. It would be great to get more details about various steps time to find targets to optimize.

Screenshot 2024-11-26 at 8 49 08 PM

Motivation

Preparing a clean state takes 10-30% of each e2e test runtime, so finding optimization opportunities can significantly help with the runtime.

Proposal

Use a code like

ts := stats.NewTimingStats()
...
ts.AddCheckpoint("some_step_ms")
...
for k, v := range ts.Timings() {
	fmt.Printf("%s: %d\n", k, v.Milliseconds())
}
@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