From 0706496528cdecd6a01ca847e3deb0a223c425d8 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 2 Dec 2024 16:08:13 +0100 Subject: pkg/bisect: recognize lost connection errors Only select them as relevant if there are not other crash types. --- pkg/bisect/bisect.go | 5 +++++ pkg/bisect/bisect_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) (limited to 'pkg') diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 1abd65e6b..e8f85c47f 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -992,6 +992,11 @@ func mostFrequentReports(reports []*report.Report) (*report.Report, []crash.Type // bisecting this kind of a bug. continue } + if info.t == crash.LostConnection && len(perType) > 1 { + // This crash type is much more often unrelated than not. + // Take it only if it's the only crash type. + continue + } // Take further crash types until we have considered 2/3 of all crashes, but // no more than 3. needTaken := (crashes + 2) * 2 / 3 diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go index 5160cffed..959d6640a 100644 --- a/pkg/bisect/bisect_test.go +++ b/pkg/bisect/bisect_test.go @@ -958,6 +958,34 @@ func TestMostFrequentReport(t *testing.T) { report: "A", other: true, }, + { + name: "do not take lost connection", + reports: []*report.Report{ + {Title: "A", Type: crash.LostConnection}, + {Title: "B", Type: crash.Warning}, + {Title: "C", Type: crash.LostConnection}, + {Title: "D", Type: crash.Warning}, + {Title: "E", Type: crash.LostConnection}, + {Title: "F", Type: crash.Warning}, + }, + types: []crash.Type{crash.Warning}, + report: "B", + other: true, + }, + { + name: "only lost connection", + reports: []*report.Report{ + {Title: "A", Type: crash.LostConnection}, + {Title: "B", Type: crash.LostConnection}, + {Title: "C", Type: crash.LostConnection}, + {Title: "D", Type: crash.LostConnection}, + {Title: "E", Type: crash.LostConnection}, + {Title: "F", Type: crash.LostConnection}, + }, + types: []crash.Type{crash.LostConnection}, + report: "A", + other: false, + }, } for _, test := range tests { test := test -- cgit mrf-deployment