diff --git a/test/e2e/app_autosync_test.go b/test/e2e/app_autosync_test.go index aee676f220..33f3b75477 100644 --- a/test/e2e/app_autosync_test.go +++ b/test/e2e/app_autosync_test.go @@ -47,6 +47,7 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) { app.Spec.SyncPolicy = &SyncPolicy{Automated: &SyncPolicyAutomated{SelfHeal: true}} }). Then(). + Expect(OperationPhaseIs(OperationSucceeded)). Expect(SyncStatusIs(SyncStatusCodeSynced)). When(). // app should be auto-synced once k8s change detected @@ -55,12 +56,14 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) { "guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`))) }). Then(). + Expect(OperationPhaseIs(OperationSucceeded)). Expect(SyncStatusIs(SyncStatusCodeSynced)). When(). // app should be attempted to auto-synced once and marked with error after failed attempt detected PatchFile("guestbook-ui-deployment.yaml", `[{"op": "replace", "path": "/spec/revisionHistoryLimit", "value": "badValue"}]`). Refresh(RefreshTypeNormal). Then(). + Expect(OperationPhaseIs(OperationFailed)). Expect(SyncStatusIs(SyncStatusCodeOutOfSync)). Expect(Condition(ApplicationConditionSyncError, "Failed sync attempt")) } diff --git a/test/e2e/fixture/app/context.go b/test/e2e/fixture/app/context.go index 9c16231be8..2b35f0d6db 100644 --- a/test/e2e/fixture/app/context.go +++ b/test/e2e/fixture/app/context.go @@ -35,7 +35,7 @@ type Context struct { func Given(t *testing.T) *Context { fixture.EnsureCleanState(t) - return &Context{t: t, destServer: KubernetesInternalAPIServerAddr, repoURLType: fixture.RepoURLTypeFile, name: fixture.Name(), timeout: 5, project: "default", prune: true} + return &Context{t: t, destServer: KubernetesInternalAPIServerAddr, repoURLType: fixture.RepoURLTypeFile, name: fixture.Name(), timeout: 10, project: "default", prune: true} } func (c *Context) CustomCACertAdded() *Context { diff --git a/test/e2e/hook_test.go b/test/e2e/hook_test.go index b958c5108c..7d77587fb2 100644 --- a/test/e2e/hook_test.go +++ b/test/e2e/hook_test.go @@ -274,6 +274,8 @@ func TestHookDeleteBeforeCreation(t *testing.T) { Sync(). Then(). Expect(OperationPhaseIs(OperationSucceeded)). + Expect(SyncStatusIs(SyncStatusCodeSynced)). + Expect(HealthIs(HealthStatusHealthy)). And(func(_ *Application) { var err error creationTimestamp1, err = getCreationTimestamp() @@ -286,6 +288,8 @@ func TestHookDeleteBeforeCreation(t *testing.T) { Sync(). Then(). Expect(OperationPhaseIs(OperationSucceeded)). + Expect(SyncStatusIs(SyncStatusCodeSynced)). + Expect(HealthIs(HealthStatusHealthy)). And(func(_ *Application) { creationTimestamp2, err := getCreationTimestamp() CheckError(err) @@ -295,6 +299,7 @@ func TestHookDeleteBeforeCreation(t *testing.T) { } func getCreationTimestamp() (string, error) { + FailOnErr(Run(".", "kubectl", "-n", DeploymentNamespace(), "get", "all")) return Run(".", "kubectl", "-n", DeploymentNamespace(), "get", "pod", "hook", "-o", "jsonpath={.metadata.creationTimestamp}") }