mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +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...)
|
||||
}
|
||||
|
||||
// Failf logs the fail info, including a stack trace starts at 2 levels above its caller
|
||||
// (for example, for call chain f -> g -> Failf("foo", ...) error would be logged for "f").
|
||||
// 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 "g").
|
||||
func Failf(format string, args ...interface{}) {
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
skip := 2
|
||||
skip := 1
|
||||
log("FAIL", "%s\n\nFull Stack Trace\n%s", msg, PrunedStack(skip))
|
||||
fail(nowStamp()+": "+msg, skip)
|
||||
panic("unreachable")
|
||||
|
@ -154,10 +154,14 @@ k8s.io/kubernetes/test/e2e/framework_test.glob..func1.5()
|
||||
FAIL: I'm failing.
|
||||
|
||||
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()
|
||||
log_test.go:57` + commonOutput,
|
||||
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`,
|
||||
},
|
||||
output.TestResult{
|
||||
|
Loading…
Reference in New Issue
Block a user