Skip to content

Commit

Permalink
e2e: extend deployment timeouts (kedacore#2246)
Browse files Browse the repository at this point in the history
* e2e: extending timeouts

Signed-off-by: Zbynek Roubalik <[email protected]>

* extend Redis timeouts

Signed-off-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
zroubalik authored Nov 3, 2021
1 parent b926875 commit 2669219
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
10 changes: 2 additions & 8 deletions tests/scalers/redis-lists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import test from 'ava'
import * as sh from 'shelljs'
import * as tmp from 'tmp'
import * as fs from 'fs'
import { waitForRollout } from './helpers'

const redisNamespace = 'redis'
const testNamespace = 'redis-lists-test'
Expand Down Expand Up @@ -32,14 +33,7 @@ test.before(t => {
t.is(0, sh.exec(`kubectl apply --namespace ${redisNamespace} -f ${redisDeployTmpFile.name}`).code, 'creating a Redis deployment should work.')

// wait for redis to be ready
let redisReplicaCount = '0'
for (let i = 0; i < 30; i++) {
redisReplicaCount = sh.exec(`kubectl get deploy/${redisDeploymentName} -n ${redisNamespace} -o jsonpath='{.spec.replicas}'`).stdout
if (redisReplicaCount != '1') {
sh.exec('sleep 2s')
}
}
t.is('1', redisReplicaCount, 'Redis is not in a ready state')
t.is(0, waitForRollout('deployment', redisDeploymentName, redisNamespace, 240), 'Redis is not in a ready state')

sh.exec(`kubectl create namespace ${testNamespace}`)

Expand Down
2 changes: 1 addition & 1 deletion tests/scalers/redis-sentinel-lists.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.before(t => {
)

// Wait for Redis sentinel to be ready.
t.is(0, waitForRollout('statefulset', redisStatefulSetName, redisNamespace))
t.is(0, waitForRollout('statefulset', redisStatefulSetName, redisNamespace, 240), 'Redis is not in a ready state')

// Get Redis sentinel address.
redisHost = sh.exec(`kubectl get svc ${redisService} -n ${redisNamespace} -o jsonpath='{.spec.clusterIP}'`)
Expand Down
2 changes: 1 addition & 1 deletion tests/scalers/redis-sentinel-streams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.before(t => {
)

// Wait for Redis Sentinel to be ready.
let exitCode = waitForRollout('statefulset', redisStatefulSetName, redisNamespace)
let exitCode = waitForRollout('statefulset', redisStatefulSetName, redisNamespace, 240)
t.is(0, exitCode, 'expected rollout status for redis to finish successfully')

// Get Redis Sentinel address.
Expand Down
10 changes: 2 additions & 8 deletions tests/scalers/redis-streams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import test from 'ava'
import * as sh from 'shelljs'
import * as tmp from 'tmp'
import * as fs from 'fs'
import { waitForRollout } from './helpers'

const redisNamespace = 'redis-ns'
const testNamespace = 'redis-streams-ns'
Expand All @@ -20,14 +21,7 @@ test.before(t => {
t.is(0, sh.exec(`kubectl apply --namespace ${redisNamespace} -f ${tmpFile1.name}`).code, 'creating a Redis deployment should work.')

// wait for redis to be ready
let redisReplicaCount = '0'
for (let i = 0; i < 30; i++) {
redisReplicaCount = sh.exec(`kubectl get deploy/${redisDeploymentName} -n ${redisNamespace} -o jsonpath='{.spec.replicas}'`).stdout
if (redisReplicaCount != '1') {
sh.exec('sleep 2s')
}
}
t.is('1', redisReplicaCount, 'Redis is not in a ready state')
t.is(0, waitForRollout('deployment', redisDeploymentName, redisNamespace, 240), 'Redis is not in a ready state')

sh.exec(`kubectl create namespace ${testNamespace}`)

Expand Down
4 changes: 2 additions & 2 deletions tests/scalers/solace-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class SolaceHelper {
sh.exec('sleep 2s')
t.is(
0,
sh.exec(`kubectl -n ${testNamespace} wait --for=condition=Ready --timeout=120s pod/kedalab-pubsubplus-dev-0`).code, 'Solace should be available.'
sh.exec(`kubectl -n ${testNamespace} wait --for=condition=Ready --timeout=180s pod/kedalab-pubsubplus-dev-0`).code, 'Solace should be available.'
)
sh.exec('sleep 2s')
}
Expand All @@ -43,7 +43,7 @@ export class SolaceHelper {
)
t.is(
0,
sh.exec(`kubectl -n ${testNamespace} wait --for=condition=Ready --timeout=120s pod/kedalab-helper`).code, 'kedalab-helper should be available'
sh.exec(`kubectl -n ${testNamespace} wait --for=condition=Ready --timeout=180s pod/kedalab-helper`).code, 'kedalab-helper should be available'
)
sh.exec('sleep 5s')
}
Expand Down

0 comments on commit 2669219

Please sign in to comment.