diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-12-02 16:08:13 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-12-03 09:29:37 +0000 |
| commit | 0706496528cdecd6a01ca847e3deb0a223c425d8 (patch) | |
| tree | 9f8650f72c91f7cde055f691f23b8d13d134b9cb /pkg | |
| parent | 9bacd5a34e12f90560c1d594634e0526185facde (diff) | |
pkg/bisect: recognize lost connection errors
Only select them as relevant if there are not other crash types.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/bisect/bisect.go | 5 | ||||
| -rw-r--r-- | pkg/bisect/bisect_test.go | 28 |
2 files changed, 33 insertions, 0 deletions
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 |
