Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/monitortests/network/onpremhaproxy/monitortest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 6 additions & 2 deletions pkg/monitortests/network/onpremhaproxy/monitortest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Comment thread
mkowalski marked this conversation as resolved.
for _, expectedOutput := range tt.expectedOutputs {
assert.Contains(t, junits[0].SystemOut, expectedOutput)
}
Expand Down