[8.18] (backport #8670) [testing] validate artifact hashes in artifact fetcher #8686
+50
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR improves the robustness of the test artifact fetcher by validating the integrity of downloaded packages and introducing retry logic for both corrupted downloads and snapshot metadata fetch failures. Specifically, it:
.sha512
checksum of each downloaded artifact to detect corruption..json
file for snapshot build IDs), which previously failed with transient errors.Why is it important?
This PR addresses two known failure cases in upgrade test pipelines:
.tar.gz
artifacts would not be detected, leading to tar extraction errors such asflate: corrupt input before offset...
. This caused test flakiness and debugging overhead.By introducing checksum validation and retry logic, this PR makes upgrade tests more reliable and deterministic.
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
None. This change only affects internal test infrastructure and does not impact users of the Elastic Agent or its public APIs.
How to test this PR locally
Related issues
This is an automatic backport of pull request #8670 done by [Mergify](https://mergify.com).