Skip to content

Conversation

@swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Oct 14, 2025

What does this PR do?

Fixes tests which implicitly assume beats are running as processes as opposed to otel receivers. More specifically:

  • 2952a12 makes the runtime leak test only look at beats running as processes.
  • c0d8385 makes integration tests check for running agent processes by only looking at processes without parents which are also elastic agents.
  • 72855e5 explicitly sets the runtime in tests where it matters.
  • 9d8cc7a checks for beats metrics in a more generic way.
  • 1c1a0c3 checks for the component build hash in a way that covers beats receivers as well.

Why is it important?

We want to enable beats receivers for self-monitoring by default. This PR makes the test adjustments separately to show they all pass for beats processes as well.

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
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues

@swiatekm swiatekm added skip-changelog chore Tasks that just need to be done, they are neither bug, nor enhancements backport-9.2 Automated backport to the 9.2 branch labels Oct 14, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

cc @swiatekm

@swiatekm swiatekm marked this pull request as ready for review October 14, 2025 16:22
@swiatekm swiatekm requested a review from a team as a code owner October 14, 2025 16:22
@swiatekm swiatekm requested review from blakerouse and pchila October 14, 2025 16:22
@swiatekm swiatekm added backport-active-all Automated backport with mergify to all the active branches and removed backport-9.2 Automated backport to the 9.2 branch labels Oct 14, 2025
@swiatekm swiatekm requested a review from cmacknz October 14, 2025 16:23
@swiatekm swiatekm merged commit 3ccf28d into main Oct 14, 2025
31 checks passed
@swiatekm swiatekm deleted the test/fix-tests-for-otel-self-monitoring branch October 14, 2025 18:36
@github-actions
Copy link
Contributor

@Mergifyio backport 8.18 8.19 9.0 9.1 9.2

@mergify
Copy link
Contributor

mergify bot commented Oct 14, 2025

backport 8.18 8.19 9.0 9.1 9.2

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Oct 14, 2025
)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

# Conflicts:
#	testing/integration/ess/beat_receivers_test.go
#	testing/integration/ess/metrics_monitoring_test.go
mergify bot pushed a commit that referenced this pull request Oct 14, 2025
)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

# Conflicts:
#	testing/integration/ess/metrics_monitoring_test.go
mergify bot pushed a commit that referenced this pull request Oct 14, 2025
)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

# Conflicts:
#	testing/integration/ess/beat_receivers_test.go
mergify bot pushed a commit that referenced this pull request Oct 14, 2025
)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)
mergify bot pushed a commit that referenced this pull request Oct 14, 2025
)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)
swiatekm added a commit that referenced this pull request Oct 14, 2025
) (#10552)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
swiatekm added a commit that referenced this pull request Oct 14, 2025
) (#10553)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
swiatekm added a commit that referenced this pull request Oct 15, 2025
…f monitoring default (#10550)

* Fix tests in preparation for making otel self monitoring default (#10537)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests

(cherry picked from commit 3ccf28d)

# Conflicts:
#	testing/integration/ess/metrics_monitoring_test.go

* Fix conflicts

---------

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
hayotbisonai pushed a commit to hayotbisonai/elastic-agent that referenced this pull request Nov 23, 2025
…stic#10537)

* Fix leak integration test

* Improve detection of agent processes in integration tests

* Explicitly set the runtime in monitoring integration test

* Make the check for component metrics more generic

* Check the right build hash in integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches chore Tasks that just need to be done, they are neither bug, nor enhancements skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants