Skip to content

Option in Eventually for requiring multiple successes before Accepting #1116

@lahabana

Description

@lahabana

Currently with Eventually it succeeds as soon as 1 occurence succeeds.

In kumahq/kuma we have a use case where we want to make sure that something eventually happens reliably.

What we do is:

func myCheck(g Gomega) {
  // ...
}

Eventually(myCheck).Should(Succeed)
Consistently(myCheck).Should(Succeed)

This doesn't exactly work in the following case:

  • Things succeed by default 50% of the case
  • After a while things succeed 100% of the cases

The code above will pass sometimes.

I think what we could introduce is a WithOccurrence(int) option so that Eventually will retry X times before actually succeeding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions