Skip to content

Commit

Permalink
Increase DynamoDB e2e timeouts (#2823)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Turrado Ferrero authored Mar 25, 2022
1 parent 062cbfc commit aa29331
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/scalers/aws-dynamodb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,18 @@ test.serial(`Replicas should scale to 2 (the max) then back to 0`, async t => {
};
}

t.true(await waitForDeploymentReplicaCount(0,nginxDeploymentName,dynamoDBNamespace, 60, 1000), "Replica count should start out as 0")


for (let i = 0; i <= 6; i++) {
let putCommand = new PutItemCommand(buildRecord(i));
await dynamoClient.send(putCommand)
}

let replicaCount = sh.exec(
`kubectl get deploy/${nginxDeploymentName} --namespace ${dynamoDBNamespace} -o jsonpath="{.spec.replicas}"`).stdout

t.is(replicaCount, '0', 'Replica count should start out as 0')

const maxReplicaCount = 2
const minReplicaCount = 0;

let result = await waitForDeploymentReplicaCount(maxReplicaCount, nginxDeploymentName, dynamoDBNamespace, 30)
t.is(result, true, 'Replica count should increase to the maxReplicaCount')
t.true(await waitForDeploymentReplicaCount(maxReplicaCount, nginxDeploymentName, dynamoDBNamespace, 180, 1000), 'Replica count should increase to the maxReplicaCount')

for (let i = 0; i <= 40; i++) {
let deleteItemCommand = new DeleteItemCommand({
Expand All @@ -122,8 +118,7 @@ test.serial(`Replicas should scale to 2 (the max) then back to 0`, async t => {
await dynamoClient.send(deleteItemCommand)
}

result = await waitForDeploymentReplicaCount(minReplicaCount, nginxDeploymentName, dynamoDBNamespace, 30)
t.is(result, true, 'Replica count should increase to the minReplicaCount')
t.true(await waitForDeploymentReplicaCount(minReplicaCount, nginxDeploymentName, dynamoDBNamespace, 180, 1000), 'Replica count should increase to the minReplicaCount')
})

test.after.always(async (t) => {
Expand Down

0 comments on commit aa29331

Please sign in to comment.