Alerting: Fix intermittency when seeding database in rule store tests (#64322)
Force unique IDs when seeding database
This commit is contained in:
1 parent
a31e18f6e3
commit
4a1c18abf6
1 file changed
+1
-1
@@ -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