mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Add timestamps to test info logs.
This should improve forensics on failed tests based with only the output to make the timing recoverable, with the hope that flaky tests will be easier to debug as a result. Before: INFO: foo After: Aug 4 17:42:14.876: INFO: foo
This commit is contained in:
parent
c29c8414e1
commit
ea0c35b72b
@ -195,16 +195,20 @@ type RCConfig struct {
|
||||
MaxContainerFailures *int
|
||||
}
|
||||
|
||||
func nowStamp() string {
|
||||
return time.Now().Format(time.StampMilli)
|
||||
}
|
||||
|
||||
func Logf(format string, a ...interface{}) {
|
||||
fmt.Fprintf(GinkgoWriter, "INFO: "+format+"\n", a...)
|
||||
fmt.Fprintf(GinkgoWriter, nowStamp()+": INFO: "+format+"\n", a...)
|
||||
}
|
||||
|
||||
func Failf(format string, a ...interface{}) {
|
||||
Fail(fmt.Sprintf(format, a...), 1)
|
||||
Fail(nowStamp()+": "+fmt.Sprintf(format, a...), 1)
|
||||
}
|
||||
|
||||
func Skipf(format string, args ...interface{}) {
|
||||
Skip(fmt.Sprintf(format, args...))
|
||||
Skip(nowStamp() + ": " + fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
||||
|
Loading…
Reference in New Issue
Block a user