Skip to content

Commit 1272784

Browse files
author
Mengqi Yu
authored
1 parent 44a50f7 commit 1272784

File tree

1 file changed

+7
-33
lines changed

1 file changed

+7
-33
lines changed

thirdparty/cli-utils/apply/applier_test.go

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -809,38 +809,12 @@ func TestApplier(t *testing.T) {
809809
InventoryPolicy: inventory.PolicyMustMatch,
810810
EmitStatusEvents: true,
811811
},
812-
statusEvents: []pollevent.Event{
813-
{
814-
Type: pollevent.ResourceUpdateEvent,
815-
Resource: &pollevent.ResourceStatus{
816-
Identifier: testutil.ToIdentifier(t, resources["deployment"]),
817-
Status: status.InProgressStatus,
818-
},
819-
},
820-
{
821-
Type: pollevent.ResourceUpdateEvent,
822-
Resource: &pollevent.ResourceStatus{
823-
Identifier: testutil.ToIdentifier(t, resources["deployment"]),
824-
Status: status.CurrentStatus,
825-
},
826-
},
827-
},
828-
expectedStatusEvents: []testutil.ExpEvent{
829-
{
830-
EventType: event.StatusType,
831-
StatusEvent: &testutil.ExpStatusEvent{
832-
Identifier: testutil.ToIdentifier(t, resources["deployment"]),
833-
Status: status.InProgressStatus,
834-
},
835-
},
836-
{
837-
EventType: event.StatusType,
838-
StatusEvent: &testutil.ExpStatusEvent{
839-
Identifier: testutil.ToIdentifier(t, resources["deployment"]),
840-
Status: status.CurrentStatus,
841-
},
842-
},
843-
},
812+
// There could be some status events for the existing Deployment,
813+
// but we can't always expect to receive them before the applier
814+
// exits, because the WaitTask is skipped when the ApplyTask errors.
815+
// So don't bother sending or expecting them.
816+
statusEvents: []pollevent.Event{},
817+
expectedStatusEvents: []testutil.ExpEvent{},
844818
expectedEvents: []testutil.ExpEvent{
845819
{
846820
EventType: event.InitType,
@@ -1933,7 +1907,7 @@ func TestApplierCancel(t *testing.T) {
19331907
var removed int
19341908
receivedEvents, removed = testutil.RemoveEqualEvents(receivedEvents, e)
19351909
if removed < 1 {
1936-
t.Fatalf("Expected status event not received: %#v", e.StatusEvent)
1910+
t.Errorf("Expected status event not received: %#v", e.StatusEvent)
19371911
}
19381912
}
19391913

0 commit comments

Comments
 (0)