mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 09:50:08 +00:00
Fix TestAutoSyncSelfHealEnabled test flakiness (#2293)
This commit is contained in:
parent
5516316cd2
commit
e0dd4b107c
1 changed files with 6 additions and 2 deletions
|
|
@ -57,12 +57,15 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) {
|
|||
errors.FailOnErr(fixture.KubeClientset.AppsV1().Deployments(fixture.DeploymentNamespace()).Patch(
|
||||
"guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`)))
|
||||
}).
|
||||
Refresh(RefreshTypeNormal).
|
||||
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"}]`).
|
||||
// Trigger refresh twice to make sure controller notices previously failed sync attempt before expectation timeout expires
|
||||
Refresh(RefreshTypeNormal).
|
||||
Refresh(RefreshTypeNormal).
|
||||
Then().
|
||||
Expect(OperationPhaseIs(OperationFailed)).
|
||||
|
|
@ -71,9 +74,10 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) {
|
|||
When().
|
||||
// SyncError condition should be removed after successful sync
|
||||
PatchFile("guestbook-ui-deployment.yaml", `[{"op": "replace", "path": "/spec/revisionHistoryLimit", "value": 1}]`).
|
||||
// Trigger refresh twice to make sure controller notices previously failed sync attempt before expectation timeout expires
|
||||
// Trigger refresh twice to make sure controller notices successful attempt and removes condition
|
||||
Refresh(RefreshTypeNormal).
|
||||
Refresh(RefreshTypeNormal).Then().
|
||||
Refresh(RefreshTypeNormal).
|
||||
Then().
|
||||
Expect(OperationPhaseIs(OperationSucceeded)).
|
||||
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
||||
And(func(app *Application) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue