[v9.4.x] Alerting: Fix intermittency when seeding database in rule store tests (#64326)
Alerting: Fix intermittency when seeding database in rule store tests (#64322)
Force unique IDs when seeding database
(cherry picked from commit 4a1c18abf6)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
This commit is contained in:
co-authored by
Alexander Weaver
parent
9e0cb259ee
commit
772eb4b58a
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user