Skip to content

Commit 5f895dc

Browse files
committed
fix failing test
1 parent fbc212a commit 5f895dc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cluster-autoscaler/core/scaledown/actuation/actuator_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package actuation
1818

1919
import (
2020
"fmt"
21+
"strings"
2122
"sync"
2223
"testing"
2324
"time"
@@ -1618,6 +1619,19 @@ func TestStartDeletionInBatchBasic(t *testing.T) {
16181619
}
16191620
for _, nodes := range deleteNodes {
16201621
for _, node := range nodes {
1622+
// Extract node group from node name
1623+
parts := strings.Split(node.Name, "-")
1624+
if len(parts) < 3 {
1625+
continue
1626+
}
1627+
ngName := strings.Join(parts[:2], "-")
1628+
1629+
// Skip check if no successful deletions expected for this group
1630+
if test.wantSuccessfulDeletion[ngName] == 0 {
1631+
continue
1632+
}
1633+
1634+
// Verify ObserveDeletion was called
16211635
found := false
16221636
for _, observedNode := range fakeNodeLatencyTracker.ObservedNodes {
16231637
if observedNode == node.Name {

cluster-autoscaler/core/scaledown/planner/planner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func New(context *context.AutoscalingContext, processors *processors.Autoscaling
9696
return &Planner{
9797
context: context,
9898
unremovableNodes: unremovable.NewNodes(),
99-
unneededNodes: unneeded.NewNodes(processors.NodeGroupConfigProcessor, resourceLimitsFinder, nlt),
99+
unneededNodes: unneededNodes,
100100
rs: simulator.NewRemovalSimulator(context.ListerRegistry, context.ClusterSnapshot, deleteOptions, drainabilityRules, true),
101101
actuationInjector: scheduling.NewHintingSimulator(),
102102
eligibilityChecker: eligibility.NewChecker(processors.NodeGroupConfigProcessor),

0 commit comments

Comments
 (0)