From 381c28407e842232481b160ef183b4ed92805e2a Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 18 Jun 2024 08:44:16 +0200 Subject: [PATCH] scheduler_perf: fix setting default verbosity It needs to be set twice, once for ktesting+klog, once for component-base/logs. The latter was not done before and thus quite a bit of log output was produced with verbosity 0. --- test/integration/scheduler_perf/main_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/integration/scheduler_perf/main_test.go b/test/integration/scheduler_perf/main_test.go index 2019a255293..86a4eaa337d 100644 --- a/test/integration/scheduler_perf/main_test.go +++ b/test/integration/scheduler_perf/main_test.go @@ -31,9 +31,15 @@ import ( "k8s.io/kubernetes/test/utils/ktesting" ) +// Run with -v=2, this is the default log level in production. +// +// In a PR this can be bumped up temporarily to run pull-kubernetes-scheduler-perf +// with more log output. +const defaultVerbosity = 2 + func TestMain(m *testing.M) { // Run with -v=2, this is the default log level in production. - ktesting.SetDefaultVerbosity(2) + ktesting.SetDefaultVerbosity(defaultVerbosity) // test/integration/framework/flags.go unconditionally initializes the // logging flags. That's correct for most tests, but in the @@ -56,6 +62,7 @@ func TestMain(m *testing.M) { "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ "Options are:\n"+strings.Join(featureGate.KnownFeatures(), "\n")) c := logsapi.NewLoggingConfiguration() + c.Verbosity = defaultVerbosity // This would fail if we hadn't removed the logging flags above. logsapi.AddGoFlags(c, flag.CommandLine)