Revise it test from v1/apier2_it_test.go

This commit is contained in:
armirveliaj
2024-11-04 07:08:09 -05:00
committed by Dan Christian Bogos
parent ec61b9805f
commit b2a76a1a84

View File

@@ -434,10 +434,16 @@ func testAPIerSetActionPlanDfltTime(t *testing.T) {
case "AP_MONTHLY":
// *monthly needs to match exactly the day
want := refTime.AddDate(0, 1, 0) // +1 month
if refTime.Day() == 31 {
if refTime.Month() != time.July && refTime.Month() != time.December {
want = refTime.AddDate(0, 2, 0)
}
}
if diff := want.Sub(got); diff < 0 || diff > 2*time.Second {
t.Errorf("%s scheduled date = %v, want %v (diff %v, margin 2s)",
schedAct.ActionPlanID, got.Format(time.StampMilli), want.Format(time.StampMilli), diff)
}
}
}
}