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

Recreate kind cluster after each K8s test #7111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Feb 28, 2025

What does this PR do?

Creates a new kind cluster for each K8s test.

Why is it important?

This is a temporary measure to improve K8s test reliability before we can run them in parallel. We run these tests sequentially right now, and each kind cluster is only used once, but is only cleaned up after all tests finish running. Creating and deleting kind clusters is fast relative to test run time, so this shouldn't impact total run time significantly.

Kubernetes tests took 2h 31m on this branch: https://buildkite.com/elastic/elastic-agent/builds/17875#01955b43-3ce0-4b43-814b-e433929b6ff2.
On main they recently took 2h 30m: https://buildkite.com/elastic/elastic-agent-extended-testing/builds/7791#01954e7c-ac7c-43fc-9987-1431e2c3b2ad

So there's little difference in runtime, and potential to fix some flakiness in the short-term.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

How to test this PR locally

SNAPSHOT=true EXTERNAL=true PACKAGES=docker PLATFORMS="linux/amd64" mage -v  package
Running target: Package
INSTANCE_PROVISIONER=kind STACK_PROVISIONER=stateful SNAPSHOT=true mage integration:single TestOtelKubeStackHelm

Related issues

Copy link
Contributor

mergify bot commented Feb 28, 2025

This pull request does not have a backport label. Could you fix it @swiatekm? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@swiatekm swiatekm force-pushed the ci/kind-cluster-per-test branch from 11bf290 to 4cdf1ec Compare March 3, 2025 09:06
@swiatekm swiatekm marked this pull request as ready for review March 3, 2025 12:07
@swiatekm swiatekm requested a review from a team as a code owner March 3, 2025 12:07
@swiatekm swiatekm added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Ingest-EngProd labels Mar 3, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@swiatekm swiatekm requested a review from pkoutsovasilis March 3, 2025 12:08
@swiatekm swiatekm added backport-active-all Automated backport with mergify to all the active branches automation ci labels Mar 3, 2025
This is a temporary measure to improve K8s test reliability before we
can run them in parallel. We run these tests sequentially right now, and
each kind cluster is only used once, but is only cleaned up after all
tests finish running. Creating and deleting kind
clusters is fast relative to test run time, so
this shouldn't impact total run time significantly.
@swiatekm swiatekm force-pushed the ci/kind-cluster-per-test branch from 4cdf1ec to ec65a9f Compare March 3, 2025 12:09
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@swiatekm swiatekm requested a review from a team March 3, 2025 13:55
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

cc @swiatekm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation backport-active-all Automated backport with mergify to all the active branches ci Cleanup skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Ingest-EngProd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants