119
// normalizeTestName strips all trailing parenthesized suffixes from test names,
120
// e.g. "(retry 1)", "(final)", "(timeout)".
122
>
for {
123
>
stripped := trailingSuffixRegex.ReplaceAllString(name, "")
124
>
if stripped == name {
125
>
return name
126
>
}
128
}
129
}
130
131
// groupFailuresByTest groups failures by normalized test name
133
>
grouped := make(map[string][]TestFailure)
134
>
135
>
for _, failure := range failures {
136
>
normalizedName := normalizeTestName(failure.Name)
137
>
grouped[normalizedName] = append(grouped[normalizedName], failure)
138
>
}
139
141
}
142