Skip to content

Commit

Permalink
logictest: improve progress output
Browse files Browse the repository at this point in the history
Logictests would print some progress messages to stdout as they run.
Each file prints when it ends and, while it's running, it prints
messages when statements finish successfully (but only up to once per
2s). This patch adds a second-level timestamp to those messages, in
order to provide more clues in the output of timed out logictest
packages. Otherwise, I'm always left guessing if the package had been
making constant progress until the timeout, or if it got stuck at some
point.

Release note: None
  • Loading branch information
andreimatei committed Nov 4, 2021
1 parent e4aff7f commit 06a015e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,10 @@ func (t *logicTest) close() {
// verbose is set.
func (t *logicTest) outf(format string, args ...interface{}) {
if t.verbose {
fmt.Printf(format, args...)
finalArgs := make([]interface{}, 1+len(args))
finalArgs[0] = time.Now().Format("15:04:05")
copy(finalArgs[1:], args)
fmt.Printf("[%s] "+format, finalArgs...)
fmt.Println()
log.Infof(context.Background(), format, args...)
}
Expand Down

0 comments on commit 06a015e

Please sign in to comment.