mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix flaky TestIntegrationUpdateAlertRules (#61641)
Prevents random OrgID=0 in test alert generation causing invalid alert rule.
This commit is contained in:
parent
3fe81b3c3f
commit
23e05373a7
@ -60,7 +60,7 @@ func AlertRuleGen(mutators ...AlertRuleMutator) func() *AlertRule {
|
||||
|
||||
rule := &AlertRule{
|
||||
ID: rand.Int63n(1500),
|
||||
OrgID: rand.Int63n(1500),
|
||||
OrgID: rand.Int63n(1500) + 1, // Prevent OrgID=0 as this does not pass alert rule validation.
|
||||
Title: "TEST-ALERT-" + util.GenerateShortUID(),
|
||||
Condition: "A",
|
||||
Data: []AlertQuery{GenerateAlertQuery()},
|
||||
|
@ -52,7 +52,6 @@ func TestIntegrationUpdateAlertRules(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should fail due to optimistic locking if version does not match", func(t *testing.T) {
|
||||
t.Skip() // This test intermittently fails.
|
||||
rule := createRule(t, store)
|
||||
rule.Version-- // simulate version discrepancy
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user