From 1a866b87953a273d35f54de3dcdcc04e50d06b37 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 8 Dec 2025 17:57:23 +0100 Subject: [PATCH] e2e framework: fix inconsistency in log output Example: I1208 16:01:05.852628 243 upgradedowngrade_test.go:239] get source code version: bring up v1.34: cluster is running, use KUBECONFIG=/var/run/kubernetes/admin.kubeconfig to access it I1208 16:01:05.869679 243 reflector.go:446] "Caches populated" type="*v1.ServiceAccount" reflector="k8s.io/client-go/tools/watch/informerwatcher.go:162" The first line is printed via framework.Logf, which is meant to emulate the format used by the klog text logger in the second line. The difference is that klog formats the pid with 7 characters, padding on the left with spaces. Consistency trumps brevity here, so let's format exactly as in klog. --- test/e2e/framework/ginkgologger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/framework/ginkgologger.go b/test/e2e/framework/ginkgologger.go index 6e2c9569970..d25c3d61b7c 100644 --- a/test/e2e/framework/ginkgologger.go +++ b/test/e2e/framework/ginkgologger.go @@ -110,7 +110,7 @@ func log(offset int, msg string) { } _, month, day := now.Date() hour, minute, second := now.Clock() - header := fmt.Sprintf("I%02d%02d %02d:%02d:%02d.%06d %d %s:%d]", + header := fmt.Sprintf("I%02d%02d %02d:%02d:%02d.%06d %7d %s:%d]", month, day, hour, minute, second, now.Nanosecond()/1000, Pid, file, line) fmt.Fprintln(ginkgo.GinkgoWriter, header, msg)