mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix intermittency when seeding database in rule store tests (#64322)
Force unique IDs when seeding database
This commit is contained in:
parent
a31e18f6e3
commit
4a1c18abf6
@ -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…
Reference in New Issue
Block a user