diff --git a/test/integration/logs/benchmark/benchmark_test.go b/test/integration/logs/benchmark/benchmark_test.go index 6e0cbe1a438..079c198a665 100644 --- a/test/integration/logs/benchmark/benchmark_test.go +++ b/test/integration/logs/benchmark/benchmark_test.go @@ -82,6 +82,11 @@ func BenchmarkEncoding(b *testing.B) { InfoStream: &output, } klog.SetOutput(&output) + defer func() { + if err := logsapi.ResetForTest(nil); err != nil { + b.Errorf("error resetting logsapi: %v", err) + } + }() if err := logsapi.ValidateAndApplyWithOptions(c, &o, nil); err != nil { b.Fatalf("Unexpected error configuring logging: %v", err) } @@ -237,6 +242,11 @@ func benchmarkOutputFormatStream(b *testing.B, config loadGeneratorConfig, disca } klog.SetOutput(o.ErrorStream) + defer func() { + if err := logsapi.ResetForTest(nil); err != nil { + b.Errorf("error resetting logsapi: %v", err) + } + }() if err := logsapi.ValidateAndApplyWithOptions(c, &o, featureGate); err != nil { b.Fatalf("Unexpected error configuring logging: %v", err) }