Repository navigation
Retry chocolatey installer download on transient HTTP errors in test fixture - #70105
Merged
Merged
Conversation
The chocolatey_mod fixture in test_chocolatey_latest.py downloads the Chocolatey installer nupkg from community.chocolatey.org. The service periodically returns HTTP 5xx/429 from its CDN, breaking every Windows functional test run in the nightly build. Retry the download with exponential backoff on transient HTTP errors and skip the tests at runtime if the service remains unavailable — the tests literally cannot execute without the installer download, so a runtime skip is the correct semantic when the external dependency is genuinely down.
dwoz
added a commit
to dwoz/salt
that referenced
this pull request
Aug 24, 2026
Port of 3006.x fix saltstack#70105 (915b4c8) to the 3007.x test file layout. 3007.x has chocolatey/test_post_20.py where 3006.x has test_chocolatey_latest.py -- same fixture pattern, same upstream flake. The chocolatey_mod fixture downloads the Chocolatey installer nupkg from community.chocolatey.org. The service periodically returns HTTP 5xx/429 from its CDN, breaking every Windows functional test run in the nightly build. Retry the download with exponential backoff on transient HTTP errors and skip the tests at runtime if the service remains unavailable -- the tests literally cannot execute without the installer download, so a runtime skip is the correct semantic when the external dependency is genuinely down.
dwoz
added a commit
to dwoz/salt
that referenced
this pull request
Aug 25, 2026
Port of 3006.x fix saltstack#70105 (915b4c8) to the 3007.x test file layout. 3007.x has chocolatey/test_post_20.py where 3006.x has test_chocolatey_latest.py -- same fixture pattern, same upstream flake. The chocolatey_mod fixture downloads the Chocolatey installer nupkg from community.chocolatey.org. The service periodically returns HTTP 5xx/429 from its CDN, breaking every Windows functional test run in the nightly build. Retry the download with exponential backoff on transient HTTP errors and skip the tests at runtime if the service remains unavailable -- the tests literally cannot execute without the installer download, so a runtime skip is the correct semantic when the external dependency is genuinely down.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Hardens the
chocolatey_modmodule-scoped fixture intests/pytests/functional/states/test_chocolatey_latest.pyso that theWindows nightly
functional zeromq 3jobs stop failing every time theChocolatey Community Repository (community.chocolatey.org) returns a
transient HTTP 5xx / 429 from its CDN.
Two-layer fix, both applied:
cp.get_urlcall for the installer nupkg with exponentialbackoff (up to 5 attempts, cap ~30s per sleep) on the transient
markers:
HTTP 502/503/504/429, connection resets, read timeouts.pytest.skipwith a message naming the failurecount and the last error. This is not a
skipifat collectiontime hiding a Salt bug — it fires only when the external service is
genuinely down, and the tests literally cannot run without the
installer download.
What issues does this PR fix or reference?
No open issue — surfaced by the nightly job failure:
Both nights, both Windows 2022 and Windows 2025, the
Test Salt / Windows <year> functional zeromq 3job failed atchocolatey_modfixture setup with:Previous Behavior
Any transient blip from community.chocolatey.org made the fixture
raise on the first call, erroring all five tests
(
test_installed_latest,test_installed_version,test_installed_version_existing_capitalization,test_uninstalled,test_upgraded) at setup.New Behavior
Transient HTTP errors are retried with backoff; if the service is
still down after the retry budget is exhausted, the tests are skipped
at runtime with a clear message rather than reported as errors.
Merge-forward
This will merge forward to 3007.x / 3008.x / master via the standard
merge-forward branches. No sibling PRs.
Test-only change
This is a test-fixture hardening only. No production Salt code is
touched, so no changelog fragment. A regression test for this class of
fix is impractical — it would require simulating community.chocolatey.org
returning HTTP 504.
Merge requirements satisfied?
Commits signed with GPG?
Yes