Update workhorse zipartifacts test to ensure minimum number of range requests
requested to merge 625-add-tests-for-serving-content-from-large-zip-files-with-lots-of-metadata into master
What does this MR do and why?
Workhorses's zipartifacts
uses a http-client based ReaderAt
implementation that fetches parts of a remote zip file by using Range
headers.
We don't have direct control of the ranges that will be requested, so this test ensures that changes to the underlying zip reader won't negatively affect performance by making more range requests than expected.
Such a change was made recently in go 1.17 and we had to downgrade. This test has been added to detect such a scenario from happening again.
How to set up and validate locally
The below manual test uses asdf
to swap Go versions.
Go <1.17
# Ensure a go version below 1.17 is being used
echo "golang 1.16.8" > .tool-versions
# Test should complete successfully
go test -v -run TestOpenHTTPArchive ./internal/zipartifacts -count 1
Go =1.17
echo "golang 1.17" > .tool-versions
# Test should fail, complaining about the range requests
go test -v -run TestOpenHTTPArchive ./internal/zipartifacts -count 1
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Relates to #340778 (closed)
Edited by Arran Walker