Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase DynamoDB e2e timeouts #2823

Merged
merged 1 commit into from
Mar 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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