mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Merge pull request #113390 from pohly/e2e-framework-fix-failure-stack
e2e framework: fix incorrect backtrace in Failf
This commit is contained in:
commit
0d4878e448
@ -41,11 +41,11 @@ func Logf(format string, args ...interface{}) {
|
|||||||
log("INFO", format, args...)
|
log("INFO", format, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Failf logs the fail info, including a stack trace starts at 2 levels above its caller
|
// Failf logs the fail info, including a stack trace starts with its direct caller
|
||||||
// (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "f").
|
// (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "g").
|
||||||
func Failf(format string, args ...interface{}) {
|
func Failf(format string, args ...interface{}) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
msg := fmt.Sprintf(format, args...)
|
||||||
skip := 2
|
skip := 1
|
||||||
log("FAIL", "%s\n\nFull Stack Trace\n%s", msg, PrunedStack(skip))
|
log("FAIL", "%s\n\nFull Stack Trace\n%s", msg, PrunedStack(skip))
|
||||||
fail(nowStamp()+": "+msg, skip)
|
fail(nowStamp()+": "+msg, skip)
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
|
@ -154,10 +154,14 @@ k8s.io/kubernetes/test/e2e/framework_test.glob..func1.5()
|
|||||||
FAIL: I'm failing.
|
FAIL: I'm failing.
|
||||||
|
|
||||||
Full Stack Trace
|
Full Stack Trace
|
||||||
|
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1(...)
|
||||||
|
log_test.go:56
|
||||||
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
|
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
|
||||||
log_test.go:57` + commonOutput,
|
log_test.go:57` + commonOutput,
|
||||||
Failure: "I'm failing.",
|
Failure: "I'm failing.",
|
||||||
Stack: `k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
|
Stack: `k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1(...)
|
||||||
|
log_test.go:56
|
||||||
|
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
|
||||||
log_test.go:57`,
|
log_test.go:57`,
|
||||||
},
|
},
|
||||||
output.TestResult{
|
output.TestResult{
|
||||||
|
Loading…
Reference in New Issue
Block a user