@@ -808,38 +808,12 @@ func TestApplier(t *testing.T) {
808808 InventoryPolicy : inventory .PolicyMustMatch ,
809809 EmitStatusEvents : true ,
810810 },
811- statusEvents : []pollevent.Event {
812- {
813- Type : pollevent .ResourceUpdateEvent ,
814- Resource : & pollevent.ResourceStatus {
815- Identifier : testutil .ToIdentifier (t , resources ["deployment" ]),
816- Status : status .InProgressStatus ,
817- },
818- },
819- {
820- Type : pollevent .ResourceUpdateEvent ,
821- Resource : & pollevent.ResourceStatus {
822- Identifier : testutil .ToIdentifier (t , resources ["deployment" ]),
823- Status : status .CurrentStatus ,
824- },
825- },
826- },
827- expectedStatusEvents : []testutil.ExpEvent {
828- {
829- EventType : event .StatusType ,
830- StatusEvent : & testutil.ExpStatusEvent {
831- Identifier : testutil .ToIdentifier (t , resources ["deployment" ]),
832- Status : status .InProgressStatus ,
833- },
834- },
835- {
836- EventType : event .StatusType ,
837- StatusEvent : & testutil.ExpStatusEvent {
838- Identifier : testutil .ToIdentifier (t , resources ["deployment" ]),
839- Status : status .CurrentStatus ,
840- },
841- },
842- },
811+ // There could be some status events for the existing Deployment,
812+ // but we can't always expect to receive them before the applier
813+ // exits, because the WaitTask is skipped when the ApplyTask errors.
814+ // So don't bother sending or expecting them.
815+ statusEvents : []pollevent.Event {},
816+ expectedStatusEvents : []testutil.ExpEvent {},
843817 expectedEvents : []testutil.ExpEvent {
844818 {
845819 EventType : event .InitType ,
@@ -1505,7 +1479,7 @@ func TestApplier(t *testing.T) {
15051479 var removed int
15061480 receivedEvents , removed = testutil .RemoveEqualEvents (receivedEvents , e )
15071481 if removed < 1 {
1508- t .Fatalf ("Expected status event not received: %#v" , e .StatusEvent )
1482+ t .Errorf ("Expected status event not received: %#v" , e .StatusEvent )
15091483 }
15101484 }
15111485
@@ -1942,7 +1916,7 @@ func TestApplierCancel(t *testing.T) {
19421916 var removed int
19431917 receivedEvents , removed = testutil .RemoveEqualEvents (receivedEvents , e )
19441918 if removed < 1 {
1945- t .Fatalf ("Expected status event not received: %#v" , e .StatusEvent )
1919+ t .Errorf ("Expected status event not received: %#v" , e .StatusEvent )
19461920 }
19471921 }
19481922
0 commit comments