Fixes TestDeletingAppStuckInSync. Closes #2087 (#2093)

This commit is contained in:
Alex Collins 2019-08-02 15:06:59 -07:00 committed by GitHub
parent bc77e8ce12
commit 583be34815
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,18 +3,15 @@ package e2e
import (
"testing"
"github.com/argoproj/argo-cd/errors"
. "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
. "github.com/argoproj/argo-cd/test/e2e/fixture"
. "github.com/argoproj/argo-cd/test/e2e/fixture/app"
"github.com/argoproj/argo-cd/test/fixture/test"
)
// when a app gets stuck in sync, and we try to delete it, it won't delete, instead we must then terminate it
// and deletion will then just happen
func TestDeletingAppStuckInSync(t *testing.T) {
test.Flaky(t)
Given(t).
Async(true).
Path("hook").
@ -25,6 +22,8 @@ func TestDeletingAppStuckInSync(t *testing.T) {
Then().
// stuck in running state
Expect(OperationPhaseIs(OperationRunning)).
Expect(SyncStatusIs(SyncStatusCodeSynced)).
Expect(ResourceResultNumbering(2)).
When().
Delete(true).
Then().
@ -34,7 +33,7 @@ func TestDeletingAppStuckInSync(t *testing.T) {
TerminateOp().
And(func() {
// force delete the resource
_, _ = Run("", "kubectl", "-n", DeploymentNamespace(), "exec", "-i", "hook", "touch", "/tmp/done")
errors.FailOnErr(Run("", "kubectl", "-n", DeploymentNamespace(), "exec", "-i", "hook", "touch", "/tmp/done"))
}).
Then().
// delete is successful