Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
61940: roachtest: fix log depth for test status r=andreimatei a=andreimatei

The number of stack frames to be skipped was not computed correctly when
t.Status() was logging. All the messages indicated that they were coming
from the t.Status() function, instead of indicating the caller.

Release note: None

61952: roachtest: fix error formatting in web UI r=andreimatei a=andreimatei

Newlines in errors were not rendering in the web UI, because HTML. And
roachtest loves errors with lots and lots of lines.

Release note: None

Co-authored-by: Andrei Matei <[email protected]>
  • Loading branch information
craig[bot] and andreimatei committed Mar 15, 2021
3 parents 3f9831f + b644eac + 4afd1f7 commit 97f40dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ func (t *test) status(ctx context.Context, id int64, args ...interface{}) {
}
if !t.l.closed() {
if id == t.runnerID {
t.l.PrintfCtxDepth(ctx, 2, "test status: %s", msg)
t.l.PrintfCtxDepth(ctx, 3, "test status: %s", msg)
} else {
t.l.PrintfCtxDepth(ctx, 2, "test worker status: %s", msg)
t.l.PrintfCtxDepth(ctx, 3, "test worker status: %s", msg)
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/roachtest/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package main
import (
"context"
"fmt"
"html"
"io"
"math/rand"
"net"
Expand Down Expand Up @@ -1107,7 +1108,7 @@ func (r *testRunner) serveHTTP(wr http.ResponseWriter, req *http.Request) {
name := fmt.Sprintf("%s (run %d)", t.test, t.run)
status := "PASS"
if !t.pass {
status = "FAIL " + t.failure
status = "FAIL " + strings.ReplaceAll(html.EscapeString(t.failure), "\n", "<br>")
}
duration := fmt.Sprintf("%s (%s - %s)", t.end.Sub(t.start), t.start, t.end)
fmt.Fprintf(wr, "<tr><td>%s</td><td>%s</td><td>%s</td><tr/>", name, status, duration)
Expand Down

0 comments on commit 97f40dc

Please sign in to comment.