Skip to content

Commit

Permalink
removed truncateinstancetypes and removed eventually
Browse files Browse the repository at this point in the history
  • Loading branch information
edibble21 committed Oct 30, 2024
1 parent cde4623 commit d48b0e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 5 additions & 15 deletions pkg/controllers/provisioning/scheduling/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()
Expand All @@ -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())
Expand Down

0 comments on commit d48b0e3

Please sign in to comment.