mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Explicitly log how long each step of e2e setup/test/teardown takes.
This commit is contained in:
parent
f03a267089
commit
170962becb
@ -31,6 +31,7 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -84,6 +85,7 @@ type TestResult struct {
|
||||
type ResultsByTest map[string]TestResult
|
||||
|
||||
func main() {
|
||||
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||
flag.Parse()
|
||||
|
||||
if *isup {
|
||||
@ -297,6 +299,10 @@ func finishRunning(stepName string, cmd *exec.Cmd) bool {
|
||||
cmd.Stderr = os.Stderr
|
||||
}
|
||||
log.Printf("Running: %v", stepName)
|
||||
defer func(start time.Time) {
|
||||
log.Printf("Step '%s' finished in %s", stepName, time.Since(start))
|
||||
}(time.Now())
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Printf("Error running %v: %v", stepName, err)
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user