mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
logs benchmark: fix config handling
The logs config must be reset explicitly now when changing it multiple times per process.
This commit is contained in:
parent
773ad73b90
commit
7f1a30f8d5
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user