From dd88e867eb640eddb10cf9ccb14f0c82161857bf Mon Sep 17 00:00:00 2001 From: Mateusz Kowalski Date: Fri, 26 Jun 2026 10:44:52 +0200 Subject: [PATCH] OCPBUGS-9209: monitor/haproxy: treat all-apiservers-down test as flake The haproxy all-apiservers-down monitor test was recently enabled to actually fail, but its detection logic is still being tuned. In the meantime it blocks payload acceptance for pre-existing conditions. Return both a failure and a success junit when the test fails, which the CI system treats as a flake. This lets us track flake rates in Sippy without blocking nightly payloads while we refine the detection sensitivity. Signed-off-by: Mateusz Kowalski Generated-by: AI Signed-off-by: Mateusz Kowalski --- pkg/monitortests/network/onpremhaproxy/monitortest.go | 5 ++++- .../network/onpremhaproxy/monitortest_test.go | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg/monitortests/network/onpremhaproxy/monitortest.go b/pkg/monitortests/network/onpremhaproxy/monitortest.go index cf27966a159e..cd0c12817a0e 100644 --- a/pkg/monitortests/network/onpremhaproxy/monitortest.go +++ b/pkg/monitortests/network/onpremhaproxy/monitortest.go @@ -440,7 +440,10 @@ func evaluateFullAPIOutages(downIntervals monitorapi.Intervals) []*junitapi.JUni SystemOut: strings.Join(failures, "\n"), } - return []*junitapi.JUnitTestCase{failure} + // Return both failure and success so the CI system treats this as a flake + // rather than a hard failure. This lets us track flake rates in Sippy + // without blocking payload acceptance while we tune the detection logic. + return []*junitapi.JUnitTestCase{failure, {Name: testName}} } func (w *operatorLogAnalyzer) WriteContentToStorage(ctx context.Context, storageDir, timeSuffix string, finalIntervals monitorapi.Intervals, finalResourceState monitorapi.ResourcesMap) error { diff --git a/pkg/monitortests/network/onpremhaproxy/monitortest_test.go b/pkg/monitortests/network/onpremhaproxy/monitortest_test.go index 0abbc3460340..49b61d51d5cf 100644 --- a/pkg/monitortests/network/onpremhaproxy/monitortest_test.go +++ b/pkg/monitortests/network/onpremhaproxy/monitortest_test.go @@ -263,14 +263,18 @@ func TestEvaluateFullAPIOutages(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { junits := evaluateFullAPIOutages(tt.intervals) - require.Len(t, junits, 1) if !tt.expectFailure { + require.Len(t, junits, 1) assert.Nil(t, junits[0].FailureOutput, "expected the test to pass") return } - require.NotNil(t, junits[0].FailureOutput, "expected the test to fail") + // Failures return both a failure and a success junit so that the CI system + // treats the result as a flake rather than a hard failure. + require.Len(t, junits, 2, "expected both a failure and a flake-success junit") + require.NotNil(t, junits[0].FailureOutput, "expected the first junit to be a failure") + assert.Nil(t, junits[1].FailureOutput, "expected the second junit to be a success (flake marker)") for _, expectedOutput := range tt.expectedOutputs { assert.Contains(t, junits[0].SystemOut, expectedOutput) }