Skip to content

Commit 1f971e0

Browse files
Merge pull request #31343 from mkowalski/fix/haproxy-all-down-flake-fallback
NO-ISSUE: monitor/haproxy: treat all-apiservers-down test as flake
2 parents 817fa8a + dd88e86 commit 1f971e0

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

pkg/monitortests/network/onpremhaproxy/monitortest.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,10 @@ func evaluateFullAPIOutages(downIntervals monitorapi.Intervals) []*junitapi.JUni
440440
SystemOut: strings.Join(failures, "\n"),
441441
}
442442

443-
return []*junitapi.JUnitTestCase{failure}
443+
// Return both failure and success so the CI system treats this as a flake
444+
// rather than a hard failure. This lets us track flake rates in Sippy
445+
// without blocking payload acceptance while we tune the detection logic.
446+
return []*junitapi.JUnitTestCase{failure, {Name: testName}}
444447
}
445448

446449
func (w *operatorLogAnalyzer) WriteContentToStorage(ctx context.Context, storageDir, timeSuffix string, finalIntervals monitorapi.Intervals, finalResourceState monitorapi.ResourcesMap) error {

pkg/monitortests/network/onpremhaproxy/monitortest_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,18 @@ func TestEvaluateFullAPIOutages(t *testing.T) {
263263
for _, tt := range tests {
264264
t.Run(tt.name, func(t *testing.T) {
265265
junits := evaluateFullAPIOutages(tt.intervals)
266-
require.Len(t, junits, 1)
267266

268267
if !tt.expectFailure {
268+
require.Len(t, junits, 1)
269269
assert.Nil(t, junits[0].FailureOutput, "expected the test to pass")
270270
return
271271
}
272272

273-
require.NotNil(t, junits[0].FailureOutput, "expected the test to fail")
273+
// Failures return both a failure and a success junit so that the CI system
274+
// treats the result as a flake rather than a hard failure.
275+
require.Len(t, junits, 2, "expected both a failure and a flake-success junit")
276+
require.NotNil(t, junits[0].FailureOutput, "expected the first junit to be a failure")
277+
assert.Nil(t, junits[1].FailureOutput, "expected the second junit to be a success (flake marker)")
274278
for _, expectedOutput := range tt.expectedOutputs {
275279
assert.Contains(t, junits[0].SystemOut, expectedOutput)
276280
}

0 commit comments

Comments
 (0)