Alerting: Fix intermittency when seeding database in rule store tests (#64322)

Force unique IDs when seeding database
pull/63495/head
Alexander Weaver 2 years ago committed by GitHub
parent a31e18f6e3
commit 4a1c18abf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/services/ngalert/store/alert_rule_test.go

@ -176,7 +176,7 @@ func TestIntegration_CountAlertRules(t *testing.T) {
}
func createRule(t *testing.T, store *DBstore) *models.AlertRule {
rule := models.AlertRuleGen(withIntervalMatching(store.Cfg.BaseInterval))()
rule := models.AlertRuleGen(withIntervalMatching(store.Cfg.BaseInterval), models.WithUniqueID())()
err := store.SQLStore.WithDbSession(context.Background(), func(sess *db.Session) error {
_, err := sess.Table(models.AlertRule{}).InsertOne(rule)
if err != nil {

Loading…
Cancel
Save