Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion test/e2e/upgrade/alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,17 @@ count_over_time(ALERTS{alertstate="firing",severity!="info",alertname!~"Watchdog
}

// Invariant: There should be no pending alerts 1m after the upgrade completes
pendingAlertQuery := `ALERTS{alertname!~"Watchdog|AlertmanagerReceiversNotConfigured",alertstate="pending",severity!="info"}`
pendingAlertQuery := fmt.Sprintf(`
sort_desc(
time() * ALERTS + 1
-
last_over_time((
time() * ALERTS{alertname!~"Watchdog|AlertmanagerReceiversNotConfigured",alertstate="pending",severity!="info"}
unless
ALERTS offset 1s
)[%[1]s:1s])
)
`, testDuration)
result, err = helper.RunQuery(pendingAlertQuery, ns, execPod.Name, t.url, t.bearerToken)
o.Expect(err).NotTo(o.HaveOccurred(), "unable to retrieve pending alerts after upgrade")
for _, series := range result.Data.Result {
Expand Down
12 changes: 11 additions & 1 deletion test/extended/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,17 @@ count_over_time(ALERTS{alertstate="firing",severity!="info",alertname!~"Watchdog
}

// Invariant: There should be no pending alerts after the test run
pendingAlertQuery := `ALERTS{alertname!~"Watchdog|AlertmanagerReceiversNotConfigured",alertstate="pending",severity!="info"}`
pendingAlertQuery := fmt.Sprintf(`
sort_desc(
time() * ALERTS + 1
-
last_over_time((
time() * ALERTS{alertname!~"Watchdog|AlertmanagerReceiversNotConfigured",alertstate="pending",severity!="info"}
unless
ALERTS offset 1s
)[%[1]s:1s])
)
`, testDuration)
result, err = helper.RunQuery(pendingAlertQuery, ns, execPod.Name, url, bearerToken)
o.Expect(err).NotTo(o.HaveOccurred(), "unable to retrieve pending alerts after upgrade")
for _, series := range result.Data.Result {
Expand Down