diff --git a/test/e2e/framework/internal/output/output.go b/test/e2e/framework/internal/output/output.go index e64c0894e5c..4599817ad66 100644 --- a/test/e2e/framework/internal/output/output.go +++ b/test/e2e/framework/internal/output/output.go @@ -110,6 +110,7 @@ func simplify(in string, expected TestResult) string { out := normalizeLocation(in) out = stripTimes(out) out = stripAddresses(out) + out = normalizeInitFunctions(out) if expected.NormalizeOutput != nil { out = expected.NormalizeOutput(out) } @@ -178,3 +179,12 @@ func normalizeLocation(in string) string { out = klogPrefix.ReplaceAllString(out, " ") return out } + +var initFunc = regexp.MustCompile(`(init\.+func|glob\.+func)`) + +// normalizeInitFunctions maps both init.func (used by Go >= 1.22) and +// glob..func (used by Go < 1.22) to . +func normalizeInitFunctions(in string) string { + out := initFunc.ReplaceAllString(in, "") + return out +}