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

The Opposite of FlakeAttempts #1034

Closed
astrieanna opened this issue Sep 1, 2022 · 1 comment · Fixed by #1051
Closed

The Opposite of FlakeAttempts #1034

astrieanna opened this issue Sep 1, 2022 · 1 comment · Fixed by #1051

Comments

@astrieanna
Copy link

There's a set of tests that we want to rerun 10 times per run of the suite; kind of the opposite of FlakeAttempts, since the goal is they have to run and pass 10 times to count as passing.

The goal is to ensure that a setting that causes the code-under-test's output to be ordered is actually working, rather than the random order happening to align with sorted order sometimes.

// Test this 10 times to eliminate randomness
DescribeTable("Sorted",
  func(x, y, z SomeType) {
    // Expect stuff to be sorted
  },
  basicTests,
  // TODO find a better way than copy pasting
  basicTests,
  basicTests,
  basicTests,
  basicTests,
  basicTests,
  basicTests,
  basicTests,
  basicTests,
  basicTests,
)

Is there a better way to write that in Ginkgo currently?

My dream is a new decorator that does the opposite of FlakeAttempts, so maybe RequiredPasses. This has only come up once in our test suites that I know of (and thus isn't really worth investing time in improving), so I figured I'd layout the request to see if comes up for anyone else.

@onsi
Copy link
Owner

onsi commented Sep 2, 2022

Hey @astrieanna - this totally makes sense and is something I've done as well (usually as a for loop either around an It or in the body of an It). There is a CLI flag ginkgo -repeat=N which will repeat the entire suite (and you could pair with filters to just repeat one test) but really this should be a decorator likeFlakeAttempts.

I'll add it to the backlog.

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

Successfully merging a pull request may close this issue.

2 participants