Skip to content

Commit

Permalink
Fix static autoscaler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertcyran committed Feb 12, 2025
1 parent 8d78a28 commit 757072c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cluster-autoscaler/core/static_autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func TestStaticAutoscalerRunOnce(t *testing.T) {
// Remove unregistered nodes.
readyNodeLister.SetNodes([]*apiv1.Node{n1, n2})
allNodeLister.SetNodes([]*apiv1.Node{n1, n2})
allPodListerMock.On("List").Return([]*apiv1.Pod{p1, p2}, nil).Once()
allPodListerMock.On("List").Return([]*apiv1.Pod{p1}, nil).Once()
daemonSetListerMock.On("List", labels.Everything()).Return([]*appsv1.DaemonSet{}, nil).Once()
onScaleDownMock.On("ScaleDown", "ng2", "n3").Return(nil).Once()
podDisruptionBudgetListerMock.On("List").Return([]*policyv1.PodDisruptionBudget{}, nil).Once()
Expand Down Expand Up @@ -536,11 +536,6 @@ func TestStaticAutoscalerRunOnceWithScaleDownDelayPerNG(t *testing.T) {
onScaleDownMock := &onScaleDownMock{}
deleteFinished := make(chan bool, 1)

n1 := BuildTestNode("n1", 1000, 1000)
SetNodeReadyState(n1, true, time.Now())
n2 := BuildTestNode("n2", 1000, 1000)
SetNodeReadyState(n2, true, time.Now())

tn := BuildTestNode("tn", 1000, 1000)
tni := framework.NewTestNodeInfo(tn)

Expand Down Expand Up @@ -710,6 +705,11 @@ func TestStaticAutoscalerRunOnceWithScaleDownDelayPerNG(t *testing.T) {

tc.beforeTest(processors)

n1 := BuildTestNode("n1", 1000, 1000)
SetNodeReadyState(n1, true, time.Now())
n2 := BuildTestNode("n2", 1000, 1000)
SetNodeReadyState(n2, true, time.Now())

provider.AddNode("ng1", n1)
provider.AddNode("ng2", n2)
ng1.SetTargetSize(1)
Expand Down

0 comments on commit 757072c

Please sign in to comment.