-
Notifications
You must be signed in to change notification settings - Fork 148
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
Remove the agent version override in tests. #3563
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
🌐 Coverage report
|
341a84a
to
24f8690
Compare
We now have working 8.12.0 and 8.11.0 snapshots.
24f8690
to
7e653eb
Compare
buildkite test this |
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.
The change is ok but the latest buildkite run is worrying: https://buildkite.com/elastic/elastic-agent/builds/3864
The TestAPM
and TestStandaloneUpgradeWithGPGFallback
fail again (symptoms look very similar to the fleet bootstrap issue we already experienced during 8.11.0 FF)
I relaunched an integration test run but this should not be merged until we get a clean run
Edit: me and @michalpristas had a look on main and this does not reintroduce the bootstrap mode we saw last week
However the failures for the tests need to be investigated anyways (the GPG ones look likethey are coming from 8.11.0 not being released but being selected as a version for the downgrade)
It looks like the explicit test failure is trying to grab a snapshot URL that doesn't exist (maybe it's getting the hash wrong?) but I also noticed this line which looks weird to me:
Is this an intentional "upgrade" to a lower version, or is the test misbehaving? |
When we call https://artifacts-api.elastic.co/v1/versions/ it reports that 8.11 is a known version which isn't expected. This is because an 8.11 BC exists and we would need to download that. {"versions":["7.17.10","7.17.11","7.17.12","7.17.13","7.17.14-SNAPSHOT","7.17.14","8.7.1","8.8.0","8.8.1","8.8.2","8.9.0","8.9.1","8.9.2","8.10.0-SNAPSHOT","8.10.0","8.10.1-SNAPSHOT","8.10.1","8.10.2-SNAPSHOT","8.10.2","8.10.3-SNAPSHOT","8.10.3","8.11.0-SNAPSHOT","8.11.0","8.12.0-SNAPSHOT"],"aliases":["7.17-SNAPSHOT","7.17","8.7","8.8","8.9","8.10-SNAPSHOT","8.10","8.11-SNAPSHOT","8.11","8.12-SNAPSHOT"],"manifests":{"last-update-time":"Tue, 10 Oct 2023 18:24:10 UTC","seconds-since-last-update":14}} The problem is it comes from https://staging.elastic.co/8.11.0-8f52d632/summary-8.11.0.html#elastic-agent which we have no special handling for in the agent. This is because there is no obvious qualifier in the version itself to tell us to look in staging like there is for snapshots: elastic-agent/internal/pkg/agent/application/upgrade/artifact/download/snapshot/downloader.go Line 23 in 7e653eb
We can either unconditionally use the snapshot version or look at the https://artifacts-api.elastic.co/v1/versions/8.11 to confirm the URL to use. I don't see a reason not to use snapshots since BCs have a larger time window between fixes if we need to fix a problem. |
I think what we can do is check if the highest version number only has a snapshot available (8.12.0-SNAPSHOT). If it does it is unreleased, and the previous version must also be a snapshot to guarantee it exists. The only caveat to this is we would prefer 8.11.1-SNAPSHOT to 8.11.0 once 8.11.0 is actually released, but I think that is actually preferable if we are still actively iterating on the code for the 8.11 branch. |
And now 8.12.0-SNAPSHOT is broken. |
buildkite test it |
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.
The only thing missing is a successful run of integration tests...
The RetryDownload upgrade test appears to be failing because of a bug where the the updated source URI is ignored in favour of the snapshot path. Probably this has to do with the fact that a dedicated snapshot downloader exists and gets tried before the http one so this will always fail for snapshots. {"log.level":"info","@timestamp":"2023-10-12T21:13:48.976Z","log.origin":{"file.name":"upgrade/step_download.go","file.line":59},"message":"Downloading upgrade artifact","log":{"source":"elastic-agent"},"version":"8.11.0-SNAPSHOT","source_uri":"http://localhost:35383","drop_path":"","target_path":"/opt/Elastic/Agent/data/elastic-agent-f0c25c/downloads","install_path":"/opt/Elastic/Agent/data/elastic-agent-f0c25c/install","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-10-12T21:13:48.976Z","log.origin":{"file.name":"upgrade/step_download.go","file.line":188},"message":"download attempt 1","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-10-12T21:14:26.665Z","log.origin":{"file.name":"http/downloader.go","file.line":319},"message":"download from https://snapshots.elastic.co/8.11.0-60b804d4/downloads/beats/elastic-agent/elastic-agent-8.11.0-SNAPSHOT-linux-arm64.tar.gz completed in 37 seconds @ 17.52MBps","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-10-12T21:14:26.727Z","log.origin":{"file.name":"http/downloader.go","file.line":319},"message":"download from https://snapshots.elastic.co/8.11.0-60b804d4/downloads/beats/elastic-agent/elastic-agent-8.11.0-SNAPSHOT-linux-arm64.tar.gz.sha512 completed in Less than a second @ +InfYBps","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"} |
Use the agent core version in the condition in the policy because the variable evaluation strips the snapshot suffix.
SonarQube Quality Gate |
* Remove the agent version override in tests. We now have working 8.12.0 and 8.11.0 snapshots. * Add failing unit test for upgradeable minor during FF. * Return 8.11.0-SNAPSHOT as the previous minor. * Fix broken condition in upgrade rollback test. Use the agent core version in the condition in the policy because the variable evaluation strips the snapshot suffix. * Don't auto overwrite sourceURI if it isn't the default. (cherry picked from commit 9adbac2)
* Remove the agent version override in tests. We now have working 8.12.0 and 8.11.0 snapshots. * Add failing unit test for upgradeable minor during FF. * Return 8.11.0-SNAPSHOT as the previous minor. * Fix broken condition in upgrade rollback test. Use the agent core version in the condition in the policy because the variable evaluation strips the snapshot suffix. * Don't auto overwrite sourceURI if it isn't the default. (cherry picked from commit 9adbac2)
* Remove the agent version override in tests. We now have working 8.12.0 and 8.11.0 snapshots. * Add failing unit test for upgradeable minor during FF. * Return 8.11.0-SNAPSHOT as the previous minor. * Fix broken condition in upgrade rollback test. Use the agent core version in the condition in the policy because the variable evaluation strips the snapshot suffix. * Don't auto overwrite sourceURI if it isn't the default. (cherry picked from commit 9adbac2) Co-authored-by: Craig MacKenzie <[email protected]>
* Remove the agent version override in tests. We now have working 8.12.0 and 8.11.0 snapshots. * Add failing unit test for upgradeable minor during FF. * Return 8.11.0-SNAPSHOT as the previous minor. * Fix broken condition in upgrade rollback test. Use the agent core version in the condition in the policy because the variable evaluation strips the snapshot suffix. * Don't auto overwrite sourceURI if it isn't the default. (cherry picked from commit 9adbac2) Co-authored-by: Craig MacKenzie <[email protected]>
We now have working 8.12.0, 8.11.0, and 8.10.3 snapshots.