diff --git a/tests/scalers/external-scaler.sj.test.ts b/tests/scalers/external-scaler.sj.test.ts index 8c50c19f9c4..5a5586ddc10 100644 --- a/tests/scalers/external-scaler.sj.test.ts +++ b/tests/scalers/external-scaler.sj.test.ts @@ -9,7 +9,7 @@ const serviceName = `${testName}-service` const deploymentName = `${testName}-deployment` const scaledJobName = `${testName}-scaled-job` -const maxReplicaCount = 5 +const maxReplicaCount = 3 const threshold = 10 test.before(async t => { @@ -45,7 +45,7 @@ test.before(async t => { test.serial("Deployment should scale up to maxReplicaCount", async t => { // Modify scaled job's metricValue to induce scaling t.is( - sh.exec(`kubectl apply -f ${createYamlFile(scaledJobYaml.replace("{{VALUE}}", `${threshold * 2}`))} -n ${testNamespace}`).code, + sh.exec(`kubectl apply -f ${createYamlFile(scaledJobYaml.replace("{{VALUE}}", `${threshold * maxReplicaCount}`))} -n ${testNamespace}`).code, 0, "Modifying scaled job should work" ) diff --git a/tests/scalers/external-scaler.so.test.ts b/tests/scalers/external-scaler.so.test.ts index c486c5d32ae..24a2191d415 100644 --- a/tests/scalers/external-scaler.so.test.ts +++ b/tests/scalers/external-scaler.so.test.ts @@ -67,7 +67,7 @@ test.serial("Deployment should scale up to minReplicaCount", async t => { test.serial("Deployment should scale up to maxReplicaCount", async t => { // Modify scaled object's metricValue to induce scaling t.is( - sh.exec(`kubectl apply -f ${createYamlFile(scaledObjectYaml.replace("{{VALUE}}", `${threshold * 2}`))} -n ${testNamespace}`).code, + sh.exec(`kubectl apply -f ${createYamlFile(scaledObjectYaml.replace("{{VALUE}}", `${threshold * maxReplicaCount}`))} -n ${testNamespace}`).code, 0, "Modifying scaled object should work" )