diff --git a/pkg/controllers/provisioning/scheduling/scheduling_benchmark_test.go b/pkg/controllers/provisioning/scheduling/scheduling_benchmark_test.go index 63d21dedc..aeeb80a52 100644 --- a/pkg/controllers/provisioning/scheduling/scheduling_benchmark_test.go +++ b/pkg/controllers/provisioning/scheduling/scheduling_benchmark_test.go @@ -183,7 +183,7 @@ func benchmarkScheduler(b *testing.B, instanceCount, podCount int) { podsScheduledInRound1 := 0 nodesInRound1 := 0 for i := 0; i < b.N; i++ { - results := scheduler.Solve(ctx, pods).TruncateInstanceTypes(scheduling.MaxInstanceTypes) + results := scheduler.Solve(ctx, pods) if i == 0 { minPods := math.MaxInt64 diff --git a/pkg/controllers/provisioning/scheduling/suite_test.go b/pkg/controllers/provisioning/scheduling/suite_test.go index ed2287e06..0414e1f0a 100644 --- a/pkg/controllers/provisioning/scheduling/suite_test.go +++ b/pkg/controllers/provisioning/scheduling/suite_test.go @@ -3674,7 +3674,7 @@ var _ = Context("Scheduling", func() { g.Expect(lo.FromPtr(m.Gauge.Value)).To(BeNumerically(">", 0)) }, time.Second).Should(Succeed()) }() - s.Solve(injection.WithControllerName(ctx, "provisioner"), pods).TruncateInstanceTypes(scheduling.MaxInstanceTypes) + s.Solve(injection.WithControllerName(ctx, "provisioner"), pods) wg.Wait() }) It("should surface the UnschedulablePodsCount metric while executing the scheduling loop", func() { @@ -3708,21 +3708,11 @@ var _ = Context("Scheduling", func() { for _, i := range pods { ExpectApplied(ctx, env.Client, i) } - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer GinkgoRecover() - defer wg.Done() - Eventually(func(g Gomega) { - m, ok := FindMetricWithLabelValues("karpenter_scheduler_unschedulable_pods_count", map[string]string{"controller": "provisioner"}) - g.Expect(ok).To(BeTrue()) - g.Expect(lo.FromPtr(m.Gauge.Value)).To(BeNumerically("==", 10)) - }, 10*time.Second).Should(Succeed()) - }() _, err := prov.Schedule(injection.WithControllerName(ctx, "provisioner")) + m, ok := FindMetricWithLabelValues("karpenter_scheduler_unschedulable_pods_count", map[string]string{"controller": "provisioner"}) + Expect(ok).To(BeTrue()) + Expect(lo.FromPtr(m.Gauge.Value)).To(BeNumerically("==", 10)) Expect(err).To(BeNil()) - wg.Wait() - }) It("should surface the schedulingDuration metric after executing a scheduling loop", func() { nodePool := test.NodePool() @@ -3744,7 +3734,7 @@ var _ = Context("Scheduling", func() { }) // Create 1000 pods which should take long enough to schedule that we should be able to read the queueDepth metric with a value s, err := prov.NewScheduler(ctx, pods, nil) Expect(err).To(BeNil()) - s.Solve(injection.WithControllerName(ctx, "provisioner"), pods).TruncateInstanceTypes(scheduling.MaxInstanceTypes) + s.Solve(injection.WithControllerName(ctx, "provisioner"), pods) m, ok := FindMetricWithLabelValues("karpenter_scheduler_scheduling_duration_seconds", map[string]string{"controller": "provisioner"}) Expect(ok).To(BeTrue())