Skip to content

Commit

Permalink
test: Including test options into the scheduling benchmark context (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekFrank authored Feb 28, 2025
1 parent a863104 commit 2ddac10
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ import (
"k8s.io/client-go/tools/record"
"k8s.io/utils/clock"
fakecr "sigs.k8s.io/controller-runtime/pkg/client/fake"
ctrl "sigs.k8s.io/controller-runtime/pkg/log"

v1 "sigs.k8s.io/karpenter/pkg/apis/v1"
"sigs.k8s.io/karpenter/pkg/cloudprovider"
"sigs.k8s.io/karpenter/pkg/cloudprovider/fake"
"sigs.k8s.io/karpenter/pkg/controllers/provisioning/scheduling"
"sigs.k8s.io/karpenter/pkg/controllers/state"
"sigs.k8s.io/karpenter/pkg/events"
operatorlogging "sigs.k8s.io/karpenter/pkg/operator/logging"
"sigs.k8s.io/karpenter/pkg/operator/options"
"sigs.k8s.io/karpenter/pkg/test"
)

Expand Down Expand Up @@ -135,8 +134,9 @@ func TestSchedulingProfile(t *testing.T) {

// nolint:gocyclo
func benchmarkScheduler(b *testing.B, instanceCount, podCount int) {
// disable logging
ctx = ctrl.IntoContext(context.Background(), operatorlogging.NopLogger)
// create context from background with test options
// test options disable logging by default
ctx = options.ToContext(context.Background(), test.Options())
nodePool := test.NodePool(v1.NodePool{
Spec: v1.NodePoolSpec{
Limits: v1.Limits{
Expand Down

0 comments on commit 2ddac10

Please sign in to comment.