cmd/testwrapper: handle timeouts as test failures

While investigating the fix in 7538f38671,
I was curious why the testwrapper didn't fail. Turns out if the test
times out and there was no explicit failure, the only message we get
is that the overall pkg failed and no failure information about the
individual test. This resulted in a 0 exit code.

This fixes that by failing the explicit case of the pkg failing when
there is nothing to retry for that pkg.

Updates #8493

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/9031/head
Maisem Ali 1 year ago committed by Maisem Ali
parent b90b9b4653
commit ae747a2e48

@ -247,6 +247,12 @@ func main() {
go runTests(ctx, thisRun.attempt, pt, otherArgs, ch) go runTests(ctx, thisRun.attempt, pt, otherArgs, ch)
for tr := range ch { for tr := range ch {
if tr.pkgFinished { if tr.pkgFinished {
if tr.outcome == "fail" && len(toRetry[tr.name.pkg]) == 0 {
// If a package fails and we don't have any tests to
// retry, then we should fail. This typically happens
// when a package times out.
failed = true
}
printPkgOutcome(tr.name.pkg, tr.outcome, thisRun.attempt) printPkgOutcome(tr.name.pkg, tr.outcome, thisRun.attempt)
continue continue
} }

Loading…
Cancel
Save