Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.16.z] ContentCredentials CLI fix for stream #15228

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #15165

Problem Statement

In Stream runs, for ContentCredentials, we see some occasional failures in several tests,
that attempt to add/update gpg key associated to repo/product with repo(s), then read info of the product/repo and assert the key name:

   ... setup custom repo, GPG key, add key to repo or repo's product,
        or update a GPG key already added to repo(s)

   repo = target_sat.cli.Repository.info({'id': repo['id']}) 
   assert repo['gpg-key'].get('name') == new_name
E   KeyError: 'gpg-key'

Solution

We need to wait for an in-progress Repository Metadata Generate task,
that is not handled synchronously by cli .update or cli .info. Else, the GPG key is not yet present in repo/product.

In any CLI tests adding/updating a GPG key associated to repo, or adding the key to a product containing repos,
we should wait for these repo metadata task(s), before calling info of product/repo, and asserting the key.

Related Issues

  • Intermittent Stream CLI failures in ContentCredentials, el8 and el9.
  • 1-3 of the affected tests inconsistently fail for same KeyError. Locally reproduced when full cli module is run.
  • The metadata task is one per repo with the key added, and typically lasts 3 seconds or less,
    but it is enough for an intermittent failure when trying to read the entity (repos or product) and find the key, before the task(s) finished.

PRT Case

trigger: test-robottelo
pytest: tests/foreman/cli/test_contentcredentials.py

@Satellite-QE Satellite-QE requested a review from a team as a code owner May 30, 2024 07:13
@Satellite-QE Satellite-QE added Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels May 30, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_contentcredentials.py

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label May 30, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 7193
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_contentcredentials.py --external-logging
Test Result : ================ 84 passed, 242 warnings in 1392.59s (0:23:12) =================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label May 30, 2024
@Satellite-QE Satellite-QE merged commit f40d81a into 6.16.z May 30, 2024
17 of 18 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.16.z-d88e9c05889eb13ec04f60caad617e1364d69396 branch May 30, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants