-
Notifications
You must be signed in to change notification settings - Fork 146
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
Change the selection of downgrade version in TestUpgradeBrokenPackageVersion #3458
Conversation
This pull request does not have a backport label. Could you fix it @pchila? 🙏
NOTE: |
🌐 Coverage report
|
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
// transform and reverse the version list and find the most recent version that is different from the broken version returned | ||
|
||
// look for 1 version with the current major that is lower than the current one |
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'm guessing it's 1 thing? AM I right?
// transform and reverse the version list and find the most recent version that is different from the broken version returned | |
// look for 1 version with the current major that is lower than the current one | |
// transform and reverse the version list and find the most recent version that is different from the broken version returned | |
// look for 1 version with the current major that is lower than the current one |
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.
This test overall has a problem. Being that this test is downgrading the installed build to a snapshot build, means that when 'elastic-agent uninstall' is ran at the end of the test will be the snapshots uninstall.
The snapshot uninstall might not have the required code to kill the watcher, which then means the watcher is still running and will break a following test.
@blakerouse since we start from the latest snapshot for test, we don't have that many choices about versions to move to. |
@blakerouse would running it in isolation address your concerns? for the time being. once we have previous major with proper watcher capabilities we would go back to normal runs |
@pchila We have an overall problem with all the upgrade tests in the integration suite. They are either not testing the actual agent under test (#3461) or the ending Elastic Agent is an older version of Elastic Agent that might not have required fixes for the testing suite to pass (in this case missing watcher kill).
@michalpristas I wish that would work, but uninstall is a core part of the testing framework. Running this test in isolation will still result in it failing on Windows, because it will not be able to kill the watcher. Only possible solution is to wait until the watcher is completely done running, before performing the uninstall. I think that is the only valid solution. This is the only case that works, that is still assuming that we don't hit an issue with |
Fundamentally to solve this we need the ability to upgrade to the version of the agent that was built in the PR. We need #2780. We need to move tests between previously released versions and official snapshots onto a schedule because the code in PRs doesn't affect them at all.
Agreed I think this is the only way to deal with this right now, besides skipping the test or figuring out how to unit test this instead of integration testing it. |
For standalone we mostly do, except for versions of agent where we cannot specify a For the scope of this PR, do we want to include all of those changes? Or do we create a separate issues/PRs for those ? |
@blakerouse @cmacknz Adding the wait means partially revert commit 7e86d24 where the cleanup functions have been removed. |
fe6c51f
to
e3654cb
Compare
SonarQube Quality Gate 0 Bugs No Coverage information |
@blakerouse could you give another review pass now that we have reintroduced the wait for watcher on the upgrade tests ? |
This is replaced by #3477 |
What does this PR do?
Fixes selection of the elastic agent version to downgrade to in the test so that we don't try to upgrade the agent on its own version
Why is it important?
The test outcome today depends on the order of versions returned by Artifact API making it flaky when there are some changes.
Checklist
[ ] 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 testAuthor's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
Questions to ask yourself