From 8a89a1f5a5c81b83780fde0d06e72115487ed581 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Wed, 17 Jan 2024 16:28:43 -0500 Subject: [PATCH] mark density tests as flaky --- test/e2e/framework/ginkgowrapper.go | 15 +++++++++++++++ test/e2e_node/density_test.go | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/ginkgowrapper.go b/test/e2e/framework/ginkgowrapper.go index 1e1417ea7b6..a31d2c15d07 100644 --- a/test/e2e/framework/ginkgowrapper.go +++ b/test/e2e/framework/ginkgowrapper.go @@ -526,6 +526,21 @@ func withLabel(label string) interface{} { 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 { // parts get concatenated with ":" to build the full label. parts []string diff --git a/test/e2e_node/density_test.go b/test/e2e_node/density_test.go index 57e7fc2ee01..16d0f036d74 100644 --- a/test/e2e_node/density_test.go +++ b/test/e2e_node/density_test.go @@ -76,7 +76,7 @@ var _ = SIGDescribe("Density", framework.WithSerial(), framework.WithSlow(), fun 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 // and add more tests 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{ { podsNr: 10,