Skip to content

Commit 92bc7d1

Browse files
fix: Account for batch event processing in e2e tests (argoproj#22356)
Signed-off-by: Andrii Korotkov <[email protected]>
1 parent a5e403d commit 92bc7d1

26 files changed

+52
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local
486486
ARGOCD_APPLICATIONSET_CONTROLLER_ALLOWED_SCM_PROVIDERS=http://127.0.0.1:8341,http://127.0.0.1:8342,http://127.0.0.1:8343,http://127.0.0.1:8344 \
487487
ARGOCD_E2E_TEST=true \
488488
ARGOCD_HYDRATOR_ENABLED=true \
489+
ARGOCD_CLUSTER_CACHE_EVENTS_PROCESSING_INTERVAL=1ms \
489490
goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START}
490491
ls -lrt /tmp/coverage
491492

test/e2e/fixture/account/actions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package project
22

33
import (
4+
"time"
5+
46
"github.com/stretchr/testify/require"
57

68
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
@@ -81,5 +83,6 @@ func (a *Actions) runCli(args ...string) {
8183

8284
func (a *Actions) Then() *Consequences {
8385
a.context.t.Helper()
86+
time.Sleep(fixture.WhenThenSleepInterval)
8487
return &Consequences{a.context, a}
8588
}

test/e2e/fixture/account/consequences.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package project
33
import (
44
"context"
55
"errors"
6+
"time"
67

78
"github.com/stretchr/testify/require"
89

@@ -64,5 +65,6 @@ func (c *Consequences) Given() *Context {
6465
}
6566

6667
func (c *Consequences) When() *Actions {
68+
time.Sleep(fixture.WhenThenSleepInterval)
6769
return c.actions
6870
}

test/e2e/fixture/account/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package project
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
78
"github.com/argoproj/argo-cd/v3/util/env"
@@ -45,5 +46,6 @@ func (c *Context) And(block func()) *Context {
4546
}
4647

4748
func (c *Context) When() *Actions {
49+
time.Sleep(fixture.WhenThenSleepInterval)
4850
return &Actions{context: c}
4951
}

test/e2e/fixture/admin/actions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package admin
22

33
import (
4+
"time"
5+
46
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
57
)
68

@@ -63,5 +65,6 @@ func (a *Actions) runCliWithStdin(stdin string, args ...string) {
6365

6466
func (a *Actions) Then() *Consequences {
6567
a.context.t.Helper()
68+
time.Sleep(fixture.WhenThenSleepInterval)
6669
return &Consequences{a.context, a}
6770
}

test/e2e/fixture/admin/consequences.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package admin
22

33
import (
4+
"time"
5+
6+
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
47
. "github.com/argoproj/argo-cd/v3/test/e2e/fixture/admin/utils"
58
)
69

@@ -33,5 +36,6 @@ func (c *Consequences) Given() *Context {
3336
}
3437

3538
func (c *Consequences) When() *Actions {
39+
time.Sleep(fixture.WhenThenSleepInterval)
3640
return c.actions
3741
}

test/e2e/fixture/admin/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package admin
22

33
import (
44
"testing"
5+
"time"
56

67
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
78
"github.com/argoproj/argo-cd/v3/util/env"
@@ -39,5 +40,6 @@ func (c *Context) And(block func()) *Context {
3940
}
4041

4142
func (c *Context) When() *Actions {
43+
time.Sleep(fixture.WhenThenSleepInterval)
4244
return &Actions{context: c}
4345
}

test/e2e/fixture/app/actions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"slices"
88
"strconv"
9+
"time"
910

1011
rbacv1 "k8s.io/api/rbac/v1"
1112

@@ -492,6 +493,7 @@ func (a *Actions) And(block func()) *Actions {
492493

493494
func (a *Actions) Then() *Consequences {
494495
a.context.t.Helper()
496+
time.Sleep(fixture.WhenThenSleepInterval)
495497
return &Consequences{a.context, a, 15}
496498
}
497499

test/e2e/fixture/app/consequences.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (c *Consequences) Given() *Context {
101101
}
102102

103103
func (c *Consequences) When() *Actions {
104+
time.Sleep(fixture.WhenThenSleepInterval)
104105
return c.actions
105106
}
106107

test/e2e/fixture/app/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ func (c *Context) And(block func()) *Context {
349349
}
350350

351351
func (c *Context) When() *Actions {
352+
time.Sleep(fixture.WhenThenSleepInterval)
352353
return &Actions{context: c}
353354
}
354355

0 commit comments

Comments
 (0)