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

Increase timeout for assertions in TestSetLogLevelFleetManaged #7190

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

pchila
Copy link
Member

@pchila pchila commented Mar 5, 2025

What does this PR do?

Fleet checkins may take up to 5 minutes so we need to increase timeouts for assertions in TestSetLogLevelFleetManaged to account for it as the agent may apply log level settings while there's already a Fleet check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6 minutes should give enough time to agent to set the log level and communicate it to Fleet in a new check-in request.

Why is it important?

This PR should remove flakiness coming from elastic-agent check-in timing in TestSetLogLevelFleetManaged.

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

Disruptive User Impact

How to test this PR locally

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
  agent may apply log level settings while there's already a Fleet
  check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.
@pchila pchila added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team flaky-test Unstable or unreliable test cases. skip-changelog labels Mar 5, 2025
@pchila pchila self-assigned this Mar 5, 2025
@pchila pchila requested a review from a team as a code owner March 5, 2025 07:01
@pchila pchila requested review from michalpristas and swiatekm March 5, 2025 07:01
@elasticmachine
Copy link
Contributor

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

@pchila pchila requested review from cmacknz and pkoutsovasilis March 5, 2025 07:02
Copy link
Contributor

mergify bot commented Mar 5, 2025

This pull request does not have a backport label. Could you fix it @pchila? 🙏
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.

@pchila pchila added the backport-active-all Automated backport with mergify to all the active branches label Mar 5, 2025
Copy link

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

cc @pchila

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

I'm fine with this fix, but a better approach imo would be to set a shorter poll timeout for this test. From what I can see, Fleet-Server lets us set this per-request, we'd just need to allow it to be configured in agent.

@pchila
Copy link
Member Author

pchila commented Mar 5, 2025

I'm fine with this fix, but a better approach imo would be to set a shorter poll timeout for this test. From what I can see, Fleet-Server lets us set this per-request, we'd just need to allow it to be configured in agent.

In the CI build of this PR the execution time for this test is ~160s so it doesn't look too slow.
At this moment we cannot set the timeout as fleet-server is expecting agent holding on for around 5 minutes before timing out.
For more details have a look at #5193 (comment)

@pchila pchila merged commit 12fa557 into elastic:main Mar 5, 2025
19 checks passed
mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)
mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)
mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

# Conflicts:
#	testing/integration/log_level_test.go
mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)
mergify bot pushed a commit that referenced this pull request Mar 5, 2025
Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)
pchila added a commit that referenced this pull request Mar 5, 2025
#7197)

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
pchila added a commit that referenced this pull request Mar 5, 2025
#7198)

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
pchila added a commit that referenced this pull request Mar 5, 2025
#7200)

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
pchila added a commit that referenced this pull request Mar 6, 2025
…evelFleetManaged (#7199)

* Increase timeout for assertions in TestSetLogLevelFleetManaged (#7190)

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

# Conflicts:
#	testing/integration/log_level_test.go

* Fix conflicts

---------

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
pchila added a commit that referenced this pull request Mar 6, 2025
#7201)

Fleet checkins may take up to 5 minutes so we need to increase timeouts
for assertions in TestSetLogLevelFleetManaged to account for it as the
agent may apply log level settings while there's already a Fleet
check-in in progress.
Settings timeouts for retrieving the correct log level in Fleet to 6
minutes should give enough time to agent to set the log level and
communicate it to Fleet in a new check-in request.

(cherry picked from commit 12fa557)

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
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
3 participants