Skip to content

[AI Generated] BugFix: retry SUSE package init when repos aren't ready yet#4443

Merged
LiliDeng merged 2 commits into
mainfrom
bugfix/sles-cloudregister-wait-retry_290426_151249
May 7, 2026
Merged

[AI Generated] BugFix: retry SUSE package init when repos aren't ready yet#4443
LiliDeng merged 2 commits into
mainfrom
bugfix/sles-cloudregister-wait-retry_290426_151249

Conversation

@LiliDeng
Copy link
Copy Markdown
Collaborator

Problem

On some SUSE images, repository registration is performed asynchronously after boot. When _initialize_package_installation runs before that registration completes, zypper refresh returns no enabled repositories and the test fails with:

RepoNotExistException: Repo not existing in 'SUSE Linux Enterprise Server 15 SP7'.
There are no enabled repositories defined in this image.

Fix

Decorate Suse._initialize_package_installation with @retry(exceptions=RepoNotExistException, tries=5, delay=30) so this transient state is retried before failing the test. The existing in-method waits for the zypper lock and guestregister service are unchanged; this only adds an outer retry on RepoNotExistException.

Diff

Three lines in lisa/operating_system.py (one comment + the decorator).

…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.
Copilot AI review requested due to automatic review settings April 29, 2026 07:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_installation with an outer retry on RepoNotExistException (5 tries, 30s delay).
  • Add a short comment documenting why the retry is needed.

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 33.377

@LiliDeng LiliDeng changed the title Retry SUSE package init when repos aren't ready yet [AI Generated] BugFix: retry SUSE package init when repos aren't ready yet Apr 29, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 71.947

@LiliDeng LiliDeng force-pushed the bugfix/sles-cloudregister-wait-retry_290426_151249 branch from 639bc9a to bd1374c Compare May 6, 2026 02:47
Copilot AI review requested due to automatic review settings May 6, 2026 02:47
@LiliDeng LiliDeng force-pushed the bugfix/sles-cloudregister-wait-retry_290426_151249 branch from bd1374c to 5d351d5 Compare May 6, 2026 02:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

⚠️ AI Test Selection — cancelled

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Selected test cases
smoke_test

@LiliDeng LiliDeng force-pushed the bugfix/sles-cloudregister-wait-retry_290426_151249 branch from 5d351d5 to e5b7a42 Compare May 6, 2026 02:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

⏭️ AI Test Selection — SKIPPED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Selected test cases
smoke_test

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread lisa/operating_system.py
Comment thread lisa/operating_system.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: suse sles-15-sp6 gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 78.941

@LiliDeng LiliDeng merged commit a11158d into main May 7, 2026
61 checks passed
@LiliDeng LiliDeng deleted the bugfix/sles-cloudregister-wait-retry_290426_151249 branch May 7, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants