mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-23 17:28:44 +00:00
Fix flaky TestOrphanedResource test (#2210)
This commit is contained in:
parent
8b29b9c8c2
commit
608361ce20
2 changed files with 12 additions and 6 deletions
|
|
@ -800,9 +800,7 @@ func TestOrphanedResource(t *testing.T) {
|
|||
Sync().
|
||||
Then().
|
||||
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
||||
And(func(app *Application) {
|
||||
assert.Len(t, app.Status.Conditions, 0)
|
||||
}).
|
||||
Expect(NoConditions()).
|
||||
When().
|
||||
And(func() {
|
||||
errors.FailOnErr(fixture.KubeClientset.CoreV1().ConfigMaps(fixture.DeploymentNamespace()).Create(&v1.ConfigMap{
|
||||
|
|
@ -824,7 +822,5 @@ func TestOrphanedResource(t *testing.T) {
|
|||
Refresh(RefreshTypeNormal).
|
||||
Then().
|
||||
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
||||
And(func(app *Application) {
|
||||
assert.Len(t, app.Status.Conditions, 0)
|
||||
})
|
||||
Expect(NoConditions())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,16 @@ func Condition(conditionType ApplicationConditionType, conditionMessage string)
|
|||
}
|
||||
}
|
||||
|
||||
func NoConditions() Expectation {
|
||||
return func(c *Consequences) (state, string) {
|
||||
message := "no conditions"
|
||||
if len(c.app().Status.Conditions) == 0 {
|
||||
return succeeded, message
|
||||
}
|
||||
return pending, message
|
||||
}
|
||||
}
|
||||
|
||||
func HealthIs(expected HealthStatusCode) Expectation {
|
||||
return func(c *Consequences) (state, string) {
|
||||
actual := c.app().Status.Health.Status
|
||||
|
|
|
|||
Loading…
Reference in a new issue