[AI Generated] BugFix: retry SUSE package init when repos aren't ready yet#4443
Merged
LiliDeng merged 2 commits intoMay 7, 2026
Merged
Conversation
…y yet Cloud registration of repositories on some SUSE images can still be in progress when _initialize_package_installation runs, causing zypper to report 'There are no enabled repositories defined' and the test to fail. Add @Retry on _initialize_package_installation so this transient case is retried (5 tries, 30s delay) before raising RepoNotExistException.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds resilience to SUSE package initialization by retrying when repositories aren’t yet visible (transient post-boot async registration), reducing test flakiness on affected SLES images.
Changes:
- Wrap
Suse._initialize_package_installationwith an outer retry onRepoNotExistException(5 tries, 30s delay). - Add a short comment documenting why the retry is needed.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
639bc9a to
bd1374c
Compare
bd1374c to
5d351d5
Compare
|
5d351d5 to
e5b7a42
Compare
⏭️ AI Test Selection — SKIPPED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest Selected test cases |
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: suse sles-15-sp6 gen2 latest
Test case details
|
johnsongeorge-w
approved these changes
May 6, 2026
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.
Problem
On some SUSE images, repository registration is performed asynchronously after boot. When
_initialize_package_installationruns before that registration completes,zypper refreshreturns no enabled repositories and the test fails with:Fix
Decorate
Suse._initialize_package_installationwith@retry(exceptions=RepoNotExistException, tries=5, delay=30)so this transient state is retried before failing the test. The existing in-method waits for thezypperlock andguestregisterservice are unchanged; this only adds an outer retry onRepoNotExistException.Diff
Three lines in
lisa/operating_system.py(one comment + the decorator).