Skip to content

Commit

Permalink
Remove unnecessary sleep in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dargudear-google committed Oct 8, 2024
1 parent 4542ca3 commit c514b4e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/bats/aws.bats
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ teardown_file() {
[[ "${result//$'\r'}" == "BeforeRotation" ]]

aws ssm put-parameter --name $PM_ROTATION_TEST_NAME --value AfterRotation --type SecureString --overwrite --region $REGION
sleep 180
sleep 120
result=$(kubectl --namespace $NAMESPACE exec $POD_NAME -- cat /mnt/secrets-store/$PM_ROTATION_TEST_NAME)
[[ "${result//$'\r'}" == "AfterRotation" ]]
}
Expand All @@ -91,7 +91,7 @@ teardown_file() {
[[ "${result//$'\r'}" == "BeforeRotation" ]]

aws secretsmanager put-secret-value --secret-id $SM_ROT_TEST_NAME --secret-string AfterRotation --region $REGION
sleep 180
sleep 120
result=$(kubectl --namespace $NAMESPACE exec $POD_NAME -- cat /mnt/secrets-store/$SM_ROT_TEST_NAME)
[[ "${result//$'\r'}" == "AfterRotation" ]]
}
Expand Down
2 changes: 1 addition & 1 deletion test/bats/azure.bats
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ setup() {
assert_success

envsubst < $BATS_TESTS_DIR/deployment-synck8s-azure.yaml | kubectl apply -n negative-test-ns -f -
sleep 30
sleep 5

POD=$(kubectl get pod -l app=busybox -n negative-test-ns -o jsonpath="{.items[0].metadata.name}")
cmd="kubectl describe pod $POD -n negative-test-ns | grep 'FailedMount.*failed to get secretproviderclass negative-test-ns/azure-sync.*not found'"
Expand Down
3 changes: 1 addition & 2 deletions test/bats/e2e-provider.bats
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
}

@test "CSI inline volume test with multiple secret provider class" {
sleep 180
result=$(kubectl exec secrets-store-inline-multiple-crd -- cat /mnt/secrets-store-0/$SECRET_NAME)
[[ "${result//$'\r'}" == "${SECRET_VALUE}" ]]

Expand Down Expand Up @@ -408,7 +407,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
run kubectl exec ${curl_pod_name} -n rotation -- curl http://${pod_ip}:8080/rotation?rotated=true

# wait for rotated secret to be mounted
sleep 180
sleep 120

# Save logs in case of failure in rotation
archive_info
Expand Down
4 changes: 2 additions & 2 deletions test/bats/vault.bats
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ EOF
run kubectl get pod/secrets-store-rotation
assert_success

sleep 180
sleep 120
# verify starting value
result=$(kubectl exec secrets-store-rotation -- cat /mnt/secrets-store/foo)
[[ "$result" == "start" ]]

# update the secret value
kubectl exec vault-0 --namespace=vault -- vault kv put secret/rotation foo=rotated

sleep 180
sleep 120

# verify rotated value
result=$(kubectl exec secrets-store-rotation -- cat /mnt/secrets-store/foo)
Expand Down

0 comments on commit c514b4e

Please sign in to comment.