Skip to content

Conversation

swiatekm
Copy link
Contributor

@swiatekm swiatekm commented Sep 25, 2025

What does this PR do?

Re-enables the integration test for comparing logs between beats processes and beats receivers and rewrites it to use normal integration test tooling, making it simpler and more observable:

  • Instead of uninstalling and reinstalling agent with new configuration, we install it once and just let it reload the configuration, verifying that this happened via status.
  • Use the normal install process and let agent run as a service instead of running it manually.
  • Fetches the logs by running elastic-agent logs instead of capturing agent output directly.
  • Relax the status check to only verify what we care about. This test sets an ES host that doesn't exist, so the status will eventually be degraded, but the test doesn't really care about this.

Why is it important?

This test should be enabled and reliable.

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 backport-active-all Automated backport with mergify to all the active branches labels Sep 25, 2025
@swiatekm swiatekm force-pushed the test/unskip-testbeatsreceiver-logs-install branch 2 times, most recently from 546ed7b to 3b13168 Compare September 29, 2025 13:53
Copy link

@swiatekm swiatekm force-pushed the test/unskip-testbeatsreceiver-logs-install branch 2 times, most recently from dbffc8e to 437c77c Compare October 7, 2025 10:18
@swiatekm swiatekm added flaky-test Unstable or unreliable test cases. chore Tasks that just need to be done, they are neither bug, nor enhancements Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Oct 7, 2025
@swiatekm swiatekm marked this pull request as ready for review October 7, 2025 15:53
@swiatekm swiatekm requested a review from a team as a code owner October 7, 2025 15:53
@elasticmachine
Copy link
Collaborator

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

ycombinator
ycombinator previously approved these changes Oct 8, 2025
Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

Just left a couple of minor suggestions/nits. LGTM.

ycombinator
ycombinator previously approved these changes Oct 8, 2025
@swiatekm swiatekm force-pushed the test/unskip-testbeatsreceiver-logs-install branch 2 times, most recently from 3c5f870 to a976a35 Compare October 9, 2025 09:56
@swiatekm swiatekm requested a review from a team as a code owner October 10, 2025 08:07
@swiatekm swiatekm requested a review from ycombinator October 10, 2025 12:04
@swiatekm swiatekm force-pushed the test/unskip-testbeatsreceiver-logs-install branch from 8f70b49 to f830251 Compare October 10, 2025 15:34
@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @swiatekm

@swiatekm swiatekm merged commit 71ece0d into main Oct 11, 2025
21 checks passed
@swiatekm swiatekm deleted the test/unskip-testbeatsreceiver-logs-install branch October 11, 2025 17:43
Copy link
Contributor

@Mergifyio backport 8.18 8.19 9.0 9.1 9.2

Copy link
Contributor

mergify bot commented Oct 11, 2025

backport 8.18 8.19 9.0 9.1 9.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 11, 2025
* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Switch assert to required

* Fix constants

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit 71ece0d)

# Conflicts:
#	testing/integration/ess/beat_receivers_test.go
mergify bot pushed a commit that referenced this pull request Oct 11, 2025
* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Switch assert to required

* Fix constants

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit 71ece0d)
mergify bot pushed a commit that referenced this pull request Oct 11, 2025
* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Switch assert to required

* Fix constants

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit 71ece0d)

# Conflicts:
#	testing/integration/ess/beat_receivers_test.go
mergify bot pushed a commit that referenced this pull request Oct 11, 2025
* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Switch assert to required

* Fix constants

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit 71ece0d)

# Conflicts:
#	testing/integration/ess/beat_receivers_test.go
mergify bot pushed a commit that referenced this pull request Oct 11, 2025
* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Apply suggestion from @ycombinator

Co-authored-by: Shaunak Kashyap <[email protected]>

* Switch assert to required

* Fix constants

---------

Co-authored-by: Shaunak Kashyap <[email protected]>
(cherry picked from commit 71ece0d)
swiatekm added a commit that referenced this pull request Oct 11, 2025
…0508)

* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator



* Apply suggestion from @ycombinator



* Apply suggestion from @ycombinator



* Switch assert to required

* Fix constants

---------


(cherry picked from commit 71ece0d)

Co-authored-by: Mikołaj Świątek <[email protected]>
Co-authored-by: Shaunak Kashyap <[email protected]>
swiatekm added a commit that referenced this pull request Oct 13, 2025
…0505)

* Rewrite the beats receiver log test using common tooling

* Expect the outputs to be degraded

* Relax checks

* Fix assertion

* Apply suggestion from @ycombinator



* Apply suggestion from @ycombinator



* Apply suggestion from @ycombinator



* Switch assert to required

* Fix constants

---------


(cherry picked from commit 71ece0d)

Co-authored-by: Mikołaj Świątek <[email protected]>
Co-authored-by: Shaunak Kashyap <[email protected]>
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 flaky-test Unstable or unreliable test cases. skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky Test]: TestBeatsReceiverLogs – Error: Condition never satisfied

3 participants