-
Notifications
You must be signed in to change notification settings - Fork 159
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
Check for agent rogue processes in integration tests #4225
Check for agent rogue processes in integration tests #4225
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
This pull request does not have a backport label. Could you fix it @pchila? 🙏
NOTE: |
4f09456
to
9e52ff7
Compare
9e52ff7
to
32df916
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why not fail the test as soon we detect there it another agent running, it'll lead to unexpected behaviour in the test anyway. Besides failing the test will block the PR anyway, so I'd say fail fast is better.
Also perhaps it could be more optimistic and do not fail the test when it fails getting the process information. I see it limits the information we have, but it isn't a failure in the test
Originally this was to try and correlate with logs I saw in test runs that did not have this guard. I want to fail the test because it attracts attention (nobody ever looks at the green ones) but if a test is still leaking or adding processes between start and end I want to see it, hence I let it run to completion. There was another part to this on the branch I cherry-picked this from where we try to clean up at the end of every test that installed agent after asserting no agent processes but that may be overkill for the moment Regarding failing if I cannot get process information, if that happens it may be a problem with the setup of the test and I wanted to bring that out too ;) |
36c8de0
to
04598fd
Compare
04598fd
to
b887cdd
Compare
This commit adds assertions at the beginning and at the end of Fixture.Install() checking that no agent processes are running before installing or after uninstalling. If any elastic-agent processes are detected, the test is marked as failed but it still runs to completion.
b887cdd
to
155c3ba
Compare
|
* Check for agent rogue processes in integration tests This commit adds assertions at the beginning and at the end of Fixture.Install() checking that no agent processes are running before installing or after uninstalling. If any elastic-agent processes are detected, the test is marked as failed but it still runs to completion. (cherry picked from commit bdefb2c)
This commit adds assertions at the beginning and at the end of Fixture.Install() checking that no agent processes are running before installing or after uninstalling.
If any elastic-agent processes are detected, the test is marked as failed but it still runs to completion.
What does this PR do?
This PR adds assertions for
elastic-agent
processes not running before installing or after uninstalling elastic agent in our integration tests.Why is it important?
This is needed to highlight any test that leaves agent processes running (usually watchers) which may influence other tests runs and cause flakyness.
Checklist
[ ] 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 testAuthor's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
Questions to ask yourself