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

Fix Windows flaky test TestComponentBuildHashInDiagnostics #4219

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

AndersonQ
Copy link
Member

What does this PR do?

Makes the test integration test TestComponentBuildHashInDiagnostics to wait all components to be healthy after agent installation before proceeding with the test.

Why is it important?

The test is flaky on windows because the components take too long to be healthy and report back their version_info

Checklist

  • 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~~

How to test this PR locally

  • N/A: the issue is on CI

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?
  • ...

@AndersonQ AndersonQ requested a review from a team as a code owner February 7, 2024 15:35
@AndersonQ AndersonQ self-assigned this Feb 7, 2024
Copy link
Contributor

mergify bot commented Feb 7, 2024

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

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Feb 7, 2024
@AndersonQ AndersonQ added Team:Elastic-Agent Label for the Agent team skip-changelog labels Feb 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@AndersonQ AndersonQ removed the request for review from michalpristas February 7, 2024 15:36
@AndersonQ AndersonQ enabled auto-merge (squash) February 7, 2024 15:36
Copy link
Member

@pchila pchila left a comment

Choose a reason for hiding this comment

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

One rewording and one nitpick (both non-blocking).
Looks good overall

isHealth,
1*time.Minute, 10*time.Second,
allHealthy,
5*time.Minute, 10*time.Second,
"agent did not became health. Last status: %v", &stateBuff)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"agent did not became health. Last status: %v", &stateBuff)
"agent never became healthy. Last status: %v", &stateBuff)

state := client.State(c.State)
if state != client.Healthy {
allHealthy = false
stateBuff.WriteString(fmt.Sprintf("%s not health, state: %s",
Copy link
Member

@pchila pchila Feb 7, 2024

Choose a reason for hiding this comment

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

Nitpick: couldn't you just track the last status and dump that if the assertion fails? I understand that it would be bigger but it's a test and if it fails the more information we have, the better...

Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
0.0% 0.0% Duplication on New Code

See analysis details on SonarQube

@AndersonQ AndersonQ merged commit d8f5134 into elastic:main Feb 8, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test]: TestComponentBuildHashInDiagnostics – build hash is empty
3 participants