Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Brouwer <[email protected]>
  • Loading branch information
rickbrouwer committed Jan 6, 2025
1 parent 05ccab8 commit 2bc1117
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scaling/executor/scale_scaledobjects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func TestScaleToFallbackWithCurrentReplicasAsMinimum(t *testing.T) {
client.EXPECT().Status().Times(2).Return(statusWriter)
statusWriter.EXPECT().Patch(gomock.Any(), gomock.Any(), gomock.Any()).Times(2)

scaleExecutor.RequestScale(context.TODO(), &scaledObject, false, true, &ScaleExecutorOptions{})
scaleExecutor.RequestScale(context.Background(), &scaledObject, false, true, &ScaleExecutorOptions{})

// Should use current replicas as it's higher than fallback replicas
assert.Equal(t, int32(8), scale.Spec.Replicas)
Expand Down Expand Up @@ -649,7 +649,7 @@ func TestScaleToFallbackIgnoringLowerCurrentReplicas(t *testing.T) {
client.EXPECT().Status().Times(2).Return(statusWriter)
statusWriter.EXPECT().Patch(gomock.Any(), gomock.Any(), gomock.Any()).Times(2)

scaleExecutor.RequestScale(context.TODO(), &scaledObject, false, true, &ScaleExecutorOptions{})
scaleExecutor.RequestScale(context.Background(), &scaledObject, false, true, &ScaleExecutorOptions{})

// Should use fallback replicas as it's higher than current replicas
assert.Equal(t, int32(5), scale.Spec.Replicas)
Expand Down Expand Up @@ -716,7 +716,7 @@ func TestScaleToFallbackWithoutCurrentReplicasAsMinimum(t *testing.T) {
client.EXPECT().Status().Times(2).Return(statusWriter)
statusWriter.EXPECT().Patch(gomock.Any(), gomock.Any(), gomock.Any()).Times(2)

scaleExecutor.RequestScale(context.TODO(), &scaledObject, false, true, &ScaleExecutorOptions{})
scaleExecutor.RequestScale(context.Background(), &scaledObject, false, true, &ScaleExecutorOptions{})

// Should use fallback replicas even though current replicas is higher
assert.Equal(t, int32(5), scale.Spec.Replicas)
Expand Down

0 comments on commit 2bc1117

Please sign in to comment.