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

chore: Parallelize EnsureCleanState for e2e tests, adding timing information #20998

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
47eb7af
chore: Parallelize EnsureCleanState for e2e tests, adding timing info…
andrii-korotkov-verkada Nov 29, 2024
3d35d72
Add underscores to function map keys
andrii-korotkov-verkada Nov 29, 2024
a869025
Have separate log statements for timing fields, since everything does…
andrii-korotkov-verkada Nov 29, 2024
05867e7
Re-run tests
andrii-korotkov-verkada Nov 29, 2024
698534a
Fix duplicate removal attempts, cleanup things in namespaces before r…
andrii-korotkov-verkada Nov 29, 2024
e193943
Combine config map cleanups, since they seem to have some kind of loc…
andrii-korotkov-verkada Nov 29, 2024
58ea3fb
Re-order some cleanups to not wait if something is already covered by…
andrii-korotkov-verkada Nov 29, 2024
2aed64f
Move rm temp dir to be together with re-creation, since otherwise rep…
andrii-korotkov-verkada Nov 29, 2024
cee26fa
Only update config maps and login as admin if there were any changes
andrii-korotkov-verkada Nov 29, 2024
d34d634
Also check for user being logged in
andrii-korotkov-verkada Nov 29, 2024
4760330
Improve config maps equivalency check
andrii-korotkov-verkada Nov 29, 2024
e58f2eb
Remove timing information
andrii-korotkov-verkada Nov 29, 2024
af6e5f6
Improve loops with sleep
andrii-korotkov-verkada Nov 29, 2024
75a6395
Properly propagate and handle errors for parallel functions
andrii-korotkov-verkada Dec 1, 2024
94080a1
Add missing CheckError
andrii-korotkov-verkada Dec 1, 2024
75b6bcf
Fix import
andrii-korotkov-verkada Dec 1, 2024
0b58c3f
Fix imports linter error (try 2)
andrii-korotkov-verkada Dec 1, 2024
297c9fa
Parallelize EnsureCleanState for application sets
andrii-korotkov-verkada Dec 2, 2024
c192ffe
Merge branch 'master' into 20968-parallelize-ensure-clean-state-for-e…
andrii-korotkov-verkada Dec 2, 2024
9be3af0
Fix errors.IsNotFound
andrii-korotkov-verkada Dec 2, 2024
5126885
Use errgroup to run functions in parallel
andrii-korotkov-verkada Dec 2, 2024
c1af11e
Remove name keys for functions as unused
andrii-korotkov-verkada Dec 2, 2024
f0f6300
Use apierr directly
andrii-korotkov-verkada Dec 2, 2024
e2f7cdd
Re-run tests due to flake
andrii-korotkov-verkada Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/e2e/fixture/app/consequences.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func (c *Consequences) Expect(e Expectation) *Consequences {
sleepIntervalsIdx := -1
timeout := time.Duration(c.timeout) * time.Second
for start := time.Now(); time.Since(start) < timeout; time.Sleep(sleepIntervals[sleepIntervalsIdx]) {
if sleepIntervalsIdx < len(sleepIntervals)-1 {
sleepIntervalsIdx++
}
state, message = e(c)
switch state {
case succeeded:
Expand All @@ -48,9 +51,6 @@ func (c *Consequences) Expect(e Expectation) *Consequences {
return c
}
log.Infof("pending: %s", message)
if sleepIntervalsIdx < len(sleepIntervals)-1 {
sleepIntervalsIdx++
}
}
c.context.t.Fatal("timeout waiting for: " + message)
return c
Expand Down
16 changes: 15 additions & 1 deletion test/e2e/fixture/applicationsets/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,21 @@ func (a *Actions) Update(toUpdate func(*v1alpha1.ApplicationSet)) *Actions {

var mostRecentError error

for start := time.Now(); time.Since(start) < timeout; time.Sleep(3 * time.Second) {
sleepIntervals := []time.Duration{
10 * time.Millisecond,
20 * time.Millisecond,
50 * time.Millisecond,
100 * time.Millisecond,
200 * time.Millisecond,
300 * time.Millisecond,
500 * time.Millisecond,
1 * time.Second,
}
sleepIntervalsIdx := -1
for start := time.Now(); time.Since(start) < timeout; time.Sleep(sleepIntervals[sleepIntervalsIdx]) {
if sleepIntervalsIdx < len(sleepIntervals)-1 {
sleepIntervalsIdx++
}
appSet, err := a.get()
mostRecentError = err
if err == nil {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/fixture/applicationsets/consequences.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func (c *Consequences) ExpectWithDuration(e Expectation, timeout time.Duration)
}
sleepIntervalsIdx := -1
for start := time.Now(); time.Since(start) < timeout; time.Sleep(sleepIntervals[sleepIntervalsIdx]) {
if sleepIntervalsIdx < len(sleepIntervals)-1 {
sleepIntervalsIdx++
}
state, message = e(c)
switch state {
case succeeded:
Expand All @@ -53,9 +56,6 @@ func (c *Consequences) ExpectWithDuration(e Expectation, timeout time.Duration)
return c
}
log.Infof("expectation pending: %s", message)
if sleepIntervalsIdx < len(sleepIntervals)-1 {
sleepIntervalsIdx++
}
}
c.context.t.Fatal("timeout waiting for: " + message)
return c
Expand Down
Loading