diff --git a/Makefile b/Makefile index 8dec6f04a4143..9f8adf87d44c6 100644 --- a/Makefile +++ b/Makefile @@ -486,6 +486,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local 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 \ ARGOCD_E2E_TEST=true \ ARGOCD_HYDRATOR_ENABLED=true \ + ARGOCD_CLUSTER_CACHE_EVENTS_PROCESSING_INTERVAL=1ms \ goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START} ls -lrt /tmp/coverage diff --git a/test/e2e/fixture/account/actions.go b/test/e2e/fixture/account/actions.go index aafd7e1136162..209d824254e48 100644 --- a/test/e2e/fixture/account/actions.go +++ b/test/e2e/fixture/account/actions.go @@ -1,6 +1,8 @@ package project import ( + "time" + "github.com/stretchr/testify/require" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -81,5 +83,6 @@ func (a *Actions) runCli(args ...string) { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/account/consequences.go b/test/e2e/fixture/account/consequences.go index 9c526edbbb0c1..d59008b1ba1ce 100644 --- a/test/e2e/fixture/account/consequences.go +++ b/test/e2e/fixture/account/consequences.go @@ -3,6 +3,7 @@ package project import ( "context" "errors" + "time" "github.com/stretchr/testify/require" @@ -64,5 +65,6 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/account/context.go b/test/e2e/fixture/account/context.go index d639faf1969fa..2f9af3b47ada5 100644 --- a/test/e2e/fixture/account/context.go +++ b/test/e2e/fixture/account/context.go @@ -2,6 +2,7 @@ package project import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -45,5 +46,6 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/admin/actions.go b/test/e2e/fixture/admin/actions.go index e25de18bbaa32..1c534df0f9501 100644 --- a/test/e2e/fixture/admin/actions.go +++ b/test/e2e/fixture/admin/actions.go @@ -1,6 +1,8 @@ package admin import ( + "time" + "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -63,5 +65,6 @@ func (a *Actions) runCliWithStdin(stdin string, args ...string) { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/admin/consequences.go b/test/e2e/fixture/admin/consequences.go index b9bf1dcc28dc9..9b81d4fa740fc 100644 --- a/test/e2e/fixture/admin/consequences.go +++ b/test/e2e/fixture/admin/consequences.go @@ -1,6 +1,9 @@ package admin import ( + "time" + + "github.com/argoproj/argo-cd/v3/test/e2e/fixture" . "github.com/argoproj/argo-cd/v3/test/e2e/fixture/admin/utils" ) @@ -33,5 +36,6 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/admin/context.go b/test/e2e/fixture/admin/context.go index 76d91af8677f8..8b8b44bef4595 100644 --- a/test/e2e/fixture/admin/context.go +++ b/test/e2e/fixture/admin/context.go @@ -2,6 +2,7 @@ package admin import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -39,5 +40,6 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/app/actions.go b/test/e2e/fixture/app/actions.go index d880f1b40cc33..47083b86fbef9 100644 --- a/test/e2e/fixture/app/actions.go +++ b/test/e2e/fixture/app/actions.go @@ -6,6 +6,7 @@ import ( "os" "slices" "strconv" + "time" rbacv1 "k8s.io/api/rbac/v1" @@ -492,6 +493,7 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a, 15} } diff --git a/test/e2e/fixture/app/consequences.go b/test/e2e/fixture/app/consequences.go index 05fdb17a2af4d..39c7839aa1550 100644 --- a/test/e2e/fixture/app/consequences.go +++ b/test/e2e/fixture/app/consequences.go @@ -101,6 +101,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/app/context.go b/test/e2e/fixture/app/context.go index 503405614a7b6..f3343e7d1780c 100644 --- a/test/e2e/fixture/app/context.go +++ b/test/e2e/fixture/app/context.go @@ -348,6 +348,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/applicationsets/actions.go b/test/e2e/fixture/applicationsets/actions.go index ebf755b3438aa..89c217e3ec19a 100644 --- a/test/e2e/fixture/applicationsets/actions.go +++ b/test/e2e/fixture/applicationsets/actions.go @@ -61,6 +61,7 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/applicationsets/consequences.go b/test/e2e/fixture/applicationsets/consequences.go index 22dea84247a08..1cab2b8e0067f 100644 --- a/test/e2e/fixture/applicationsets/consequences.go +++ b/test/e2e/fixture/applicationsets/consequences.go @@ -71,6 +71,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/applicationsets/context.go b/test/e2e/fixture/applicationsets/context.go index 4533bb61c3948..00bd71a1d07d5 100644 --- a/test/e2e/fixture/applicationsets/context.go +++ b/test/e2e/fixture/applicationsets/context.go @@ -29,6 +29,7 @@ func Given(t *testing.T) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/cluster/actions.go b/test/e2e/fixture/cluster/actions.go index 4c03cf570524a..66112efb786d7 100644 --- a/test/e2e/fixture/cluster/actions.go +++ b/test/e2e/fixture/cluster/actions.go @@ -5,6 +5,7 @@ import ( "errors" "log" "strings" + "time" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" @@ -131,6 +132,7 @@ func (a *Actions) DeleteByServer() *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/cluster/consequences.go b/test/e2e/fixture/cluster/consequences.go index d6a856708a91c..97a456b53e28d 100644 --- a/test/e2e/fixture/cluster/consequences.go +++ b/test/e2e/fixture/cluster/consequences.go @@ -3,6 +3,7 @@ package cluster import ( "context" "errors" + "time" clusterpkg "github.com/argoproj/argo-cd/v3/pkg/apiclient/cluster" "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" @@ -54,5 +55,6 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/cluster/context.go b/test/e2e/fixture/cluster/context.go index 83d1541772fe7..8668797065505 100644 --- a/test/e2e/fixture/cluster/context.go +++ b/test/e2e/fixture/cluster/context.go @@ -2,6 +2,7 @@ package cluster import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -59,6 +60,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/fixture.go b/test/e2e/fixture/fixture.go index 55e82fbc919b3..98a2d6ff1c5f9 100644 --- a/test/e2e/fixture/fixture.go +++ b/test/e2e/fixture/fixture.go @@ -66,6 +66,9 @@ const ( PluginSockFilePath = "/app/config/plugin" E2ETestPrefix = "e2e-test-" + + // Account for batch events processing (set to 1ms in e2e tests) + WhenThenSleepInterval = 5 * time.Millisecond ) const ( diff --git a/test/e2e/fixture/notification/actions.go b/test/e2e/fixture/notification/actions.go index 81b35e50de3d7..6a42eb1d92fcd 100644 --- a/test/e2e/fixture/notification/actions.go +++ b/test/e2e/fixture/notification/actions.go @@ -1,6 +1,8 @@ package notification import ( + "time" + "github.com/stretchr/testify/require" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -24,6 +26,7 @@ func (a *Actions) SetParamInNotificationConfigMap(key, value string) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/notification/consequences.go b/test/e2e/fixture/notification/consequences.go index 4401268a45928..6fdd8df5ee020 100644 --- a/test/e2e/fixture/notification/consequences.go +++ b/test/e2e/fixture/notification/consequences.go @@ -2,6 +2,7 @@ package notification import ( "context" + "time" "github.com/argoproj/argo-cd/v3/pkg/apiclient/notification" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -53,6 +54,7 @@ func (c *Consequences) listTemplates() (*notification.TemplateList, error) { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/notification/context.go b/test/e2e/fixture/notification/context.go index 3bf075ff54ddb..86fcad7727d83 100644 --- a/test/e2e/fixture/notification/context.go +++ b/test/e2e/fixture/notification/context.go @@ -2,6 +2,7 @@ package notification import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -23,5 +24,6 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/project/actions.go b/test/e2e/fixture/project/actions.go index 7e2df3b3e7756..39e590c4631f2 100644 --- a/test/e2e/fixture/project/actions.go +++ b/test/e2e/fixture/project/actions.go @@ -3,6 +3,7 @@ package project import ( "context" "strings" + "time" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -112,6 +113,7 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/project/consequences.go b/test/e2e/fixture/project/consequences.go index 3abcec5053555..94d868c06d56b 100644 --- a/test/e2e/fixture/project/consequences.go +++ b/test/e2e/fixture/project/consequences.go @@ -2,6 +2,7 @@ package project import ( "context" + "time" "github.com/argoproj/argo-cd/v3/pkg/apiclient/project" @@ -43,5 +44,6 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/project/context.go b/test/e2e/fixture/project/context.go index d0f9118a5b603..6c1aa2bb0d6d9 100644 --- a/test/e2e/fixture/project/context.go +++ b/test/e2e/fixture/project/context.go @@ -2,6 +2,7 @@ package project import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -68,5 +69,6 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} } diff --git a/test/e2e/fixture/repos/actions.go b/test/e2e/fixture/repos/actions.go index c573632dfd9b3..71d483fda7a62 100644 --- a/test/e2e/fixture/repos/actions.go +++ b/test/e2e/fixture/repos/actions.go @@ -2,6 +2,7 @@ package repos import ( "log" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -77,6 +78,7 @@ func (a *Actions) Project(project string) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + time.Sleep(fixture.WhenThenSleepInterval) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/repos/consequences.go b/test/e2e/fixture/repos/consequences.go index 77658077b46d8..34a891914c671 100644 --- a/test/e2e/fixture/repos/consequences.go +++ b/test/e2e/fixture/repos/consequences.go @@ -3,6 +3,7 @@ package repos import ( "context" "errors" + "time" repositorypkg "github.com/argoproj/argo-cd/v3/pkg/apiclient/repository" "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" @@ -54,5 +55,6 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return c.actions } diff --git a/test/e2e/fixture/repos/context.go b/test/e2e/fixture/repos/context.go index bb99f7ef2a450..57e6b4c127e8f 100644 --- a/test/e2e/fixture/repos/context.go +++ b/test/e2e/fixture/repos/context.go @@ -2,6 +2,7 @@ package repos import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -54,6 +55,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + time.Sleep(fixture.WhenThenSleepInterval) return &Actions{context: c} }