Skip to content

Commit

Permalink
adding e2e test for cpu scaler: updating the trigger-job , Updating c…
Browse files Browse the repository at this point in the history
…hangelog

Signed-off-by: Ritikaa96 <[email protected]>
  • Loading branch information
Ritikaa96 committed Jan 6, 2022
1 parent 21bb301 commit afa6c78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
- **PostgreSQL Scaler:** Assign PostgreSQL `userName` to correct attribute ([#2432](https://github.com/kedacore/keda/pull/2432))|([#2433](https://github.com/kedacore/keda/pull/2433))
- **Kafka Scaler:** concurrently query brokers for consumer and producer offsets ([#2405](https://github.com/kedacore/keda/pull/2405))
- **External Scaler:** fix wrong calculation of retry backoff duration ([#2416](https://github.com/kedacore/keda/pull/2416))

- **CPU Scaler:** Adding e2e test for the cpu scaler ([#2441](https://github.com/kedacore/keda/pull/2441))
### Breaking Changes

- TODO ([#XXX](https://github.com/kedacore/keda/pull/XXX))
Expand Down
14 changes: 7 additions & 7 deletions tests/scalers/cpu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ test.serial(`Creating Job should work`, async t => {
})

test.serial(`Deployment should scale to 5 after 3 minutes`, async t => {
const maxReplicaCount = '5'
// check replicacount on constant triggering :
t.true(await waitForDeploymentReplicaCount(5, 'php-apache', testNamespace, 18, 10000), 'Replica count should be 5 after 180 seconds')
})
test.serial(`Deployment should scale back to 1 after 10 minutes`, async t => {
test.serial(`Deployment should scale back to 1 after 8 minutes`, async t => {
// check for the scale down :
t.true(await waitForDeploymentReplicaCount(1, 'php-apache', testNamespace, 60, 10000), 'Replica count should be 1 after 10 minutes')
t.true(await waitForDeploymentReplicaCount(1, 'php-apache', testNamespace, 48, 10000), 'Replica count should be 1 after 8 minutes')
})

test.after.always.cb('clean up workload test related deployments', t => {
Expand Down Expand Up @@ -117,14 +116,15 @@ const triggerJob = `apiVersion: batch/v1
kind: Job
metadata:
name: trigger-job
namespace: cpu-test
spec:
template:
spec:
containers:
- image: jordi/ab
- image: busybox
name: test
command: ["/bin/sh"]
args: ["-c", "for i in $(seq 1 180);do echo $i;ab -c 5 -n 1000 -v 2 http://php-apache.cpu-test.svc/;sleep 1;done"]
args: ["-c", "for i in $(seq 1 180);do wget -q -O- http://php-apache.cpu-test.svc/;sleep 0.1;done"]
restartPolicy: Never
activeDeadlineSeconds: 300
backoffLimit: 2`
activeDeadlineSeconds: 280
backoffLimit: 3`

0 comments on commit afa6c78

Please sign in to comment.