Skip to content

Use kubectl wait to make the integration test more reliable #187

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

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

lisguo
Copy link
Contributor

@lisguo lisguo commented Jun 17, 2024

Issue #, if available: N/A

Description of changes:

  • Instead of using sleep, we should use kubectl wait for resources to be available before continuing with the test.
  • Delete pods instead of using kubectl rollout which will stagger pods, the wait command to finish early as pods will be in Ready state before restarting all pods.
  • Rename AmazonCloudWatchAgentIntegrationTest to InstrumentationTest

This error message is common in the test case for AmazonCloudWatchAgent agent pod creation step:

Error from server (InternalError): error when creating "integration-tests/manifests/cloudwatch-agent-daemonset.yaml": Internal error occurred: failed calling webhook "mamazoncloudwatchagent.kb.io": failed to call webhook: Post "[https://cloudwatch-webhook-service.amazon-cloudwatch.svc:443/mutate-cloudwatch-aws-amazon-com-v1alpha1-amazoncloudwatchagent?timeout=10s](https://cloudwatch-webhook-service.amazon-cloudwatch.svc/mutate-cloudwatch-aws-amazon-com-v1alpha1-amazoncloudwatchagent?timeout=10s)": dial tcp 10.110.30.107:443: connect: connection refused

Example run: https://github.com/aws/amazon-cloudwatch-agent-operator/actions/runs/9552268986/job/26328442298?pr=186

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lisguo lisguo requested review from Paramadon and sethAmazon June 17, 2024 19:42
@@ -53,12 +53,14 @@ jobs:
- name: Deploy operator to minikube
run: |
make deploy
kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main reason why it was flaky. operator wasn't ready to serve on the webhook.

@lisguo lisguo merged commit b7f646a into aws:main Jun 17, 2024
6 checks passed
@lisguo lisguo deleted the kubectl-wait branch June 17, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants