From 155124b59af47b7bbe0418a586c5e0053697d7e7 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 25 Oct 2026 15:58:07 +0100 Subject: [PATCH] mesh-build-go: a cause is the runtime's line at column 0, and only go's exact summary lines are dropped (issue 1901, review round 1) An indented log line of another running test that held 'panic:' won over the real timeout panic, since the lines were trimmed before matching. Go prints the runtime's lines at column 0; a test's log is indented. --- .../mesh-build-go/cmd/mesh-build-go/levels.go | 14 +++++++----- .../cmd/mesh-build-go/package_cause_test.go | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/levels.go b/modules/mesh-build-go/cmd/mesh-build-go/levels.go index 27d38434..ea5bc596 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/levels.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/levels.go @@ -192,7 +192,7 @@ func (r *reader) event(ev event) { case "output": // go test's own summary of a package ("PASS", "FAIL", "ok ", "FAIL ") is never a failure's // words: a "PASS" before a "FAIL " says only that the tests passed and the program failed after them. - switch l := strings.TrimSpace(ev.Output); { + switch l := strings.TrimRight(ev.Output, "\r\n"); { case l == "PASS": r.passed[ev.Package] = true case summaryLine(l): @@ -275,22 +275,24 @@ func clip(lines []string, cause string) string { return strings.Join(kept, "\n") } -// summaryLine says a line is go test's summary of a package: "PASS", "FAIL", "ok