Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add a retry when asserting the up metric #243

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

DnPlas
Copy link
Contributor

@DnPlas DnPlas commented Feb 23, 2024

Adding a retry for checking the state of an alert will allow time to prometheus-k8s to scrape the necessary metrics for a unit, without it we may run into a race condition where the assertion of the metric is run before prometheus is even able to scrape. This commit adds a retry logic to avoid this.

Fixes #244

TODO:

  • backport this change into track/1.17

Adding a retry for checking the state of an alert will allow time to prometheus-k8s to scrape
the necessary metrics for a unit, without it we may run into a race condition where the assertion
of the metric is run before prometheus is even able to scrape.
This commit adds a retry logic to avoid this.
@DnPlas DnPlas requested a review from a team as a code owner February 23, 2024 09:40
@DnPlas DnPlas merged commit d58d132 into main Feb 23, 2024
17 checks passed
@DnPlas DnPlas deleted the dnplas-add-retry-to-alert-rules-test-case branch February 23, 2024 11:57
DnPlas added a commit that referenced this pull request Feb 23, 2024
* tests: add a retry when asserting the up metric

Adding a retry for checking the state of an alert will allow time to prometheus-k8s to scrape
the necessary metrics for a unit, without it we may run into a race condition where the assertion
of the metric is run before prometheus is even able to scrape.
This commit adds a retry logic to avoid this.

Fixes #244
DnPlas added a commit that referenced this pull request Feb 23, 2024
* tests: add a retry when asserting the up metric

Adding a retry for checking the state of an alert will allow time to prometheus-k8s to scrape
the necessary metrics for a unit, without it we may run into a race condition where the assertion
of the metric is run before prometheus is even able to scrape.
This commit adds a retry logic to avoid this.

Fixes #244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_seldon_alert_rules test case is failing, potential race condition
2 participants