Skip to content

Fix flaky integration tests for the monitoring endpoint#10004

Merged
cmacknz merged 2 commits into
mainfrom
test/fix-failing-tests
Sep 18, 2025
Merged

Fix flaky integration tests for the monitoring endpoint#10004
cmacknz merged 2 commits into
mainfrom
test/fix-failing-tests

Conversation

@swiatekm
Copy link
Copy Markdown
Member

@swiatekm swiatekm commented Sep 17, 2025

What does this PR do?

Improves the reliability of the monitoring reload tests and fixes an issue with the fipsonly tests related to testify assertion use. These failures originally surfaced in #9952, and I've also noticed it in #9903, but the fixes are generally applicable, so I'm applying them to all branches.

Why is it important?

Tests should be 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

@swiatekm swiatekm requested a review from a team as a code owner September 17, 2025 11:19
@swiatekm swiatekm added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Sep 17, 2025
@swiatekm swiatekm added flaky-test Unstable or unreliable test cases. skip-changelog backport-active-all Automated backport with mergify to all the active branches labels Sep 17, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@swiatekm swiatekm changed the title Test/fix failing tests Fix flaky integration tests for the monitoring endpoint Sep 17, 2025
cmacknz
cmacknz previously approved these changes Sep 17, 2025
Copy link
Copy Markdown
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Thank you! Addresses what was found in #9952 (comment)

We may find we need to relax newPolicyRevision := agent.PolicyRevision + 1 to just that the new revision is greater than the old one because we don't care about the specific revision. Regardless having the revision increment by one should be what happens, we just might be exposed to bugs in Fleet where it generates unnecessary revisions or some other update (from another test that isn't as isolated as it should be) causes an extra revision.

Comment thread testing/integration/ess/monitoring_probe_preserve_text_cfg_test.go Outdated
cmacknz
cmacknz previously approved these changes Sep 17, 2025
@ycombinator ycombinator force-pushed the test/fix-failing-tests branch from 1c51244 to 2f5b10c Compare September 17, 2025 23:11
Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.
@elastic-sonarqube
Copy link
Copy Markdown

@cmacknz cmacknz enabled auto-merge (squash) September 18, 2025 02:06
@cmacknz cmacknz disabled auto-merge September 18, 2025 02:30
@cmacknz
Copy link
Copy Markdown
Member

cmacknz commented Sep 18, 2025

Force merging, the actual tests changed here have passed multiple times and now we are waiting for Kubernetes tests.

@cmacknz cmacknz merged commit 5372f24 into main Sep 18, 2025
21 of 23 checks passed
@cmacknz cmacknz deleted the test/fix-failing-tests branch September 18, 2025 02:30
@github-actions
Copy link
Copy Markdown
Contributor

@Mergifyio backport 8.18 8.19 9.0 9.1

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Sep 18, 2025

mergify Bot pushed a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
mergify Bot pushed a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
mergify Bot pushed a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
mergify Bot pushed a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
cmacknz pushed a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Sep 18, 2025

💔 Build Failed

Failed CI Steps

History

cc @swiatekm

swiatekm added a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
swiatekm added a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
swiatekm added a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
swiatekm added a commit that referenced this pull request Sep 18, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)
swiatekm added a commit that referenced this pull request Sep 18, 2025
)

* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)

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

* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)

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

* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)

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

* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana

(cherry picked from commit 5372f24)

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
intxgo pushed a commit to intxgo/elastic-agent that referenced this pull request Sep 24, 2025
* Fix monitoring reloading tests

Ensure we verify the policy update was actually applied before querying
the monitoring endpoint. Add a retry on said request as well.

* Use the explicit policy revision returned by Kibana
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 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.

3 participants