Retry stress-ng package install fallback#4542
Open
vyadavmsft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves resilience of package-based installation on Debian-family distros by retrying apt metadata refresh once when apt-cache policy indicates a package is unavailable, and it adjusts stress-ng installation to fall back to a source build when package-manager installation fails but the binary is still missing.
Changes:
- Add a one-time apt metadata refresh + retry to Debian’s
is_package_in_repopath whenapt-cache policyreports “Candidate: (none)” / “Unable to locate package”. - Update
StressNg.install()to treat repo-not-found as fatal, but otherwise allow fallback to source build when package install fails andstress-ngis still unavailable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lisa/tools/stress_ng.py | Adds package-install error handling and a “binary still missing → source build” fallback path for stress-ng. |
| lisa/operating_system.py | Adds one-time apt metadata refresh retry when apt-cache policy indicates a package has no candidate/can’t be located. |
Refresh Debian apt metadata once when apt-cache policy reports that a package has no candidate or cannot be located. This keeps the existing first-time package initialization path intact while covering transient metadata visibility issues before callers fall back to source builds. For stress-ng, keep repo-not-found failures visible, but fall back to the source build path when the package manager reports a LISA package-install failure and the binary is still unavailable. This covers apt dependency-resolution failures such as held broken packages while preserving the existing AppArmor source-build dependency fix already on main.
c86d502 to
bf92969
Compare
⏭️ AI Test Selection — SKIPPED1 test case(s) selected (view run) Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest Selected test cases |
✅ AI Test Selection — PASSED2 test case(s) selected (view run) Marketplace image: microsoftcblmariner azure-linux-3 azure-linux-3 latest
Test case details
|
Collaborator
Author
|
@LiliDeng check this pls |
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.
Refresh Debian apt metadata once when apt-cache policy reports that a package has no candidate or cannot be located. This keeps the existing first-time package initialization path intact while covering transient metadata visibility issues before callers fall back to source builds.
For stress-ng, keep repo-not-found failures visible, but fall back to the source build path when the package manager reports a LISA package-install failure and the binary is still unavailable. This covers apt dependency-resolution failures such as held broken packages while preserving the existing AppArmor source-build dependency fix already on main.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results