test: log the CLI's stderr when the db forward read fails (#1032)
TestDBForwardLongRequestThroughTheEdge failed twice on CI, each time about a second into the CLI read, but the CLI's error was lost inside Fatalf's multi-line message, which the CI summary drops. Each stderr line is now its own t.Logf, so the next failure names the cause. Test-only. Squashed from dbforward-flake-diagnostics into main.
1 file changed,
+6
−1
dbforward_e2e_test.go+6 −1
CI failed — run details
diff --git a/dbforward_e2e_test.go b/dbforward_e2e_test.go| index cf52eca3a..7b54af62a 100644 |
| --- a/dbforward_e2e_test.go |
| +++ b/dbforward_e2e_test.go |
| @@ -608,7 +608,12 @@ func checkProgressAtTheCLI(t *testing.T, e *dbfE2E, tap *dbfTap, atLeast time.Du |
| t.Logf("console conn: %s", line) |
| } |
| } |
| - t.Fatalf("%q %v\n%s", out.String(), err, strings.Join(stderr, "\n")) |
| + // The CLI's own sentence says why it stopped; log it the same way, or |
| + // the CI summary keeps only Fatalf's first line and loses it (#1032). |
| + for _, line := range stderr { |
| + t.Logf("cli stderr: %s", line) |
| + } |
| + t.Fatalf("the CLI read stopped after %s: stdout %q, %v", end.Sub(start), out.String(), err) |
| } |
| if reading.IsZero() || reading.Sub(start) > time.Second { |
| t.Fatalf("DBF-11 after %s: %q", reading.Sub(start), stderr) |