Skip to content

Commit

Permalink
Increase timeout for redis cluster in e2e tests (kedacore#1561)
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak <sah.sslpu@gmail.com>
  • Loading branch information
goku321 authored and ycabrer committed Mar 1, 2021
1 parent 1d53f65 commit c61c140
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
21 changes: 7 additions & 14 deletions tests/scalers/redis-cluster-lists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const redisWorkerHostPortRefDeploymentName = 'redis-worker-test-hostport'
const redisWorkerAddressRefDeploymentName = 'redis-worker-test-address'
const redisWorkerHostPortRefTriggerAuthDeploymentName = 'redis-worker-test-hostport-triggerauth'
const itemsToWrite = 200
const deploymentContainerImage = 'goku321/redis-cluster-list:v1.4'
const deploymentContainerImage = 'goku321/redis-cluster-list:v1.7'
const writeJobNameForHostPortRef = 'redis-writer-host-port-ref'
const writeJobNameForAddressRef = 'redis-writer-address-ref'
const writeJobNameForHostPortInTriggerAuth = 'redis-writer-host-port-trigger-auth'
Expand All @@ -29,14 +29,7 @@ test.before(t => {
sh.exec(`kubectl create namespace ${redisNamespace}`)
sh.exec(`helm repo add bitnami https://charts.bitnami.com/bitnami`)

let clusterStatus = 1
for (let i = 0; i < 3; i++) {
clusterStatus = sh.exec(`helm install ${redisClusterName} --namespace ${redisNamespace} --set "global.redis.password=${redisPassword}" bitnami/redis-cluster`).code
if (clusterStatus == 0) {
break
}
sh.exec('sleep 5s')
}
let clusterStatus = sh.exec(`helm install --timeout 600s ${redisClusterName} --namespace ${redisNamespace} --set "global.redis.password=${redisPassword}" bitnami/redis-cluster`).code
t.is(0,
clusterStatus,
'creating a Redis cluster should work.'
Expand Down Expand Up @@ -146,7 +139,7 @@ test.serial(`Deployment using redis host port env vars should max and scale to 5
runWriteJob(t, writeJobNameForHostPortRef, listNameForHostPortRef)

let replicaCount = '0'
for (let i = 0; i < 20 && replicaCount !== '5'; i++) {
for (let i = 0; i < 30 && replicaCount !== '5'; i++) {
replicaCount = sh.exec(
`kubectl get deployment/${redisWorkerHostPortRefDeploymentName} --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"`
).stdout
Expand Down Expand Up @@ -186,7 +179,7 @@ test.serial(`Deployment using redis address env var should max and scale to 5 wi
runWriteJob(t, writeJobNameForAddressRef, listNameForAddressRef)

let replicaCount = '0'
for (let i = 0; i < 20 && replicaCount !== '5'; i++) {
for (let i = 0; i < 30 && replicaCount !== '5'; i++) {
replicaCount = sh.exec(
`kubectl get deployment/${redisWorkerAddressRefDeploymentName} --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"`
).stdout
Expand Down Expand Up @@ -226,7 +219,7 @@ test.serial(`Deployment using redis host port in triggerAuth should max and scal
runWriteJob(t, writeJobNameForHostPortInTriggerAuth, listNameForHostPortTriggerAuth)

let replicaCount = '0'
for (let i = 0; i < 20 && replicaCount !== '5'; i++) {
for (let i = 0; i < 30 && replicaCount !== '5'; i++) {
replicaCount = sh.exec(
`kubectl get deployment/${redisWorkerHostPortRefTriggerAuthDeploymentName} --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"`
).stdout
Expand Down Expand Up @@ -336,7 +329,7 @@ spec:
- name: REDIS_PASSWORD
value: {{REDIS_PASSWORD}}
- name: READ_PROCESS_TIME
value: "200"
value: "500"
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
Expand Down Expand Up @@ -446,7 +439,7 @@ spec:
- name: REDIS_PASSWORD
value: {{REDIS_PASSWORD}}
- name: READ_PROCESS_TIME
value: "200"
value: "500"
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
Expand Down
13 changes: 3 additions & 10 deletions tests/scalers/redis-cluster-streams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ test.before(t => {
sh.exec(`kubectl create namespace ${redisNamespace}`)
sh.exec(`helm repo add bitnami https://charts.bitnami.com/bitnami`)

let clusterStatus = 1
for (let i = 0; i < 3; i++) {
clusterStatus = sh.exec(`helm install ${redisClusterName} --namespace ${redisNamespace} --set "global.redis.password=${redisPassword}" bitnami/redis-cluster`).code
if (clusterStatus == 0) {
break
}
sh.exec('sleep 5s')
}
let clusterStatus = sh.exec(`helm install --timeout 600s ${redisClusterName} --namespace ${redisNamespace} --set "global.redis.password=${redisPassword}" bitnami/redis-cluster`).code
t.is(0,
clusterStatus,
'creating a Redis cluster should work.'
Expand Down Expand Up @@ -167,7 +160,7 @@ spec:
spec:
containers:
- name: redis-streams-consumer
image: goku321/redis-cluster-streams:v2.3
image: goku321/redis-cluster-streams:v2.5
command: ["./main"]
args: ["consumer"]
imagePullPolicy: Always
Expand Down Expand Up @@ -218,7 +211,7 @@ spec:
spec:
containers:
- name: producer
image: goku321/redis-cluster-streams:v2.3
image: goku321/redis-cluster-streams:v2.5
command: ["./main"]
args: ["producer"]
imagePullPolicy: Always
Expand Down

0 comments on commit c61c140

Please sign in to comment.