From 2bc1117de22076659dd4dd3d1b0e6174205f6516 Mon Sep 17 00:00:00 2001 From: Rick Brouwer Date: Mon, 6 Jan 2025 10:01:15 +0100 Subject: [PATCH] Fix Signed-off-by: Rick Brouwer --- pkg/scaling/executor/scale_scaledobjects_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/scaling/executor/scale_scaledobjects_test.go b/pkg/scaling/executor/scale_scaledobjects_test.go index dab26113880..96b07da4f1c 100644 --- a/pkg/scaling/executor/scale_scaledobjects_test.go +++ b/pkg/scaling/executor/scale_scaledobjects_test.go @@ -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) @@ -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) @@ -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)