Skip to content

Commit 0706496

Browse files
committed
pkg/bisect: recognize lost connection errors
Only select them as relevant if there are not other crash types.
1 parent 9bacd5a commit 0706496

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

pkg/bisect/bisect.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,11 @@ func mostFrequentReports(reports []*report.Report) (*report.Report, []crash.Type
992992
// bisecting this kind of a bug.
993993
continue
994994
}
995+
if info.t == crash.LostConnection && len(perType) > 1 {
996+
// This crash type is much more often unrelated than not.
997+
// Take it only if it's the only crash type.
998+
continue
999+
}
9951000
// Take further crash types until we have considered 2/3 of all crashes, but
9961001
// no more than 3.
9971002
needTaken := (crashes + 2) * 2 / 3

pkg/bisect/bisect_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,34 @@ func TestMostFrequentReport(t *testing.T) {
958958
report: "A",
959959
other: true,
960960
},
961+
{
962+
name: "do not take lost connection",
963+
reports: []*report.Report{
964+
{Title: "A", Type: crash.LostConnection},
965+
{Title: "B", Type: crash.Warning},
966+
{Title: "C", Type: crash.LostConnection},
967+
{Title: "D", Type: crash.Warning},
968+
{Title: "E", Type: crash.LostConnection},
969+
{Title: "F", Type: crash.Warning},
970+
},
971+
types: []crash.Type{crash.Warning},
972+
report: "B",
973+
other: true,
974+
},
975+
{
976+
name: "only lost connection",
977+
reports: []*report.Report{
978+
{Title: "A", Type: crash.LostConnection},
979+
{Title: "B", Type: crash.LostConnection},
980+
{Title: "C", Type: crash.LostConnection},
981+
{Title: "D", Type: crash.LostConnection},
982+
{Title: "E", Type: crash.LostConnection},
983+
{Title: "F", Type: crash.LostConnection},
984+
},
985+
types: []crash.Type{crash.LostConnection},
986+
report: "A",
987+
other: false,
988+
},
961989
}
962990
for _, test := range tests {
963991
test := test

0 commit comments

Comments
 (0)