Skip to content

Commit

Permalink
Add offset to ginkgo e2e validations
Browse files Browse the repository at this point in the history
Signed-off-by: João Vilaça <jvilaca@redhat.com>
  • Loading branch information
machadovilaca committed Jan 8, 2024
1 parent 1095ef5 commit 7af6434
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/monitoring_test.go
Expand Up @@ -306,7 +306,7 @@ func checkAlert(alertName string) (*promApiv1.Alert, error) {
}

func waitForAlertToActivate(alertName string) {
Eventually(func() error {
EventuallyWithOffset(1, func() error {
alert, err := checkAlert(alertName)
if err != nil {
return err
Expand All @@ -319,7 +319,7 @@ func waitForAlertToActivate(alertName string) {
}

func alertShouldNotBeActive(alertName string) {
Eventually(func() error {
EventuallyWithOffset(1, func() error {
alert, err := checkAlert(alertName)
if err != nil {
return err
Expand All @@ -330,7 +330,7 @@ func alertShouldNotBeActive(alertName string) {
return fmt.Errorf("alert %s found", alertName)
}, env.Timeout(), time.Second).ShouldNot(HaveOccurred())

Consistently(func() error {
ConsistentlyWithOffset(1, func() error {
alert, err := checkAlert(alertName)
if err != nil {
return err
Expand All @@ -343,7 +343,7 @@ func alertShouldNotBeActive(alertName string) {
}

func waitForSeriesToBeDetected(seriesName string) {
Eventually(func() bool {
EventuallyWithOffset(1, func() bool {
results, _, err := getPrometheusClient().Query(context.TODO(), seriesName, time.Now())
Expect(err).ShouldNot(HaveOccurred())
return results.String() != ""
Expand Down

0 comments on commit 7af6434

Please sign in to comment.