mark density tests as flaky

This commit is contained in:
Kevin Hannon 2024-01-17 16:28:43 -05:00
parent f40ff3d9ff
commit 8a89a1f5a5
2 changed files with 17 additions and 2 deletions

View File

@ -526,6 +526,21 @@ func withLabel(label string) interface{} {
return newLabel(label) return newLabel(label)
} }
// WithFlaky specifies that a certain test or group of tests are failing randomly.
// These tests are usually filtered out and ran separately from other tests.
func WithFlaky() interface{} {
return withFlaky()
}
// WithFlaky is a shorthand for the corresponding package function.
func (f *Framework) WithFlaky() interface{} {
return withFlaky()
}
func withFlaky() interface{} {
return newLabel("Flaky")
}
type label struct { type label struct {
// parts get concatenated with ":" to build the full label. // parts get concatenated with ":" to build the full label.
parts []string parts []string

View File

@ -76,7 +76,7 @@ var _ = SIGDescribe("Density", framework.WithSerial(), framework.WithSlow(), fun
rc = NewResourceCollector(containerStatsPollingPeriod) rc = NewResourceCollector(containerStatsPollingPeriod)
}) })
ginkgo.Context("create a batch of pods", func() { f.Context("create a batch of pods", framework.WithFlaky(), func() {
// TODO(coufon): the values are generous, set more precise limits with benchmark data // TODO(coufon): the values are generous, set more precise limits with benchmark data
// and add more tests // and add more tests
dTests := []densityTest{ dTests := []densityTest{
@ -225,7 +225,7 @@ var _ = SIGDescribe("Density", framework.WithSerial(), framework.WithSlow(), fun
} }
}) })
ginkgo.Context("create a sequence of pods", func() { f.Context("create a sequence of pods", framework.WithFlaky(), func() {
dTests := []densityTest{ dTests := []densityTest{
{ {
podsNr: 10, podsNr: 10,