Fix flaky unitest expecting event
@@ -1057,8 +1057,10 @@ var _ = Describe("Refresh Host", func() {
Expect(db.Create(&host).Error).ShouldNot(HaveOccurred())
cluster = getTestCluster(clusterId, "1.2.3.0/24")
Expect(db.Create(&cluster).Error).ToNot(HaveOccurred())
+ if passedTimeKind == "over_timeout" {
mockEvents.EXPECT().AddEvent(gomock.Any(), host.ClusterID, &hostId, hostutil.GetEventSeverityFromHostStatus(models.HostStatusError),
gomock.Any(), gomock.Any())
+ }
err := hapi.RefreshStatus(ctx, &host, db)
Expect(err).ToNot(HaveOccurred())
