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

Quick fix- CI failure- for number of found CV publish tasks #14890

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Apr 25, 2024

Problem Statement

test_negative_publish_during_repo_sync: Sometimes, more than one content-view publish task is present,
so we should search that there are > 0, and get most recent task from search, [index 0].

  • The reason seems to be because in this module, when the full session is run, an associated composite content-view still exists from another test, which will generate extra task(s).

Related Issues

CI failure for stream, 6.15.z combined sessions, because occasionally we find 2 or 3 matching tasks, instead of exactly 1.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync

@damoore044 damoore044 added Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Apr 25, 2024
@damoore044 damoore044 requested a review from a team April 25, 2024 19:28
@damoore044 damoore044 self-assigned this Apr 25, 2024
@damoore044 damoore044 requested a review from a team as a code owner April 25, 2024 19:28
@damoore044 damoore044 changed the title CI fix for number of found CV publish tasks Quick fix- CI failure- for number of found CV publish tasks Apr 25, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6701
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync --external-logging
Test Result : ================== 1 passed, 10 warnings in 720.67s (0:12:00) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 25, 2024
@@ -571,7 +571,7 @@ def test_negative_publish_during_repo_sync(self, content_view, module_target_sat
task_search = module_target_sat.api.ForemanTask().search(
query={'search': f'{task_action} and started_at >= "{timestamp}"'}
)
assert len(task_search) == 1
assert len(task_search) > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

You can get the task id of publish task and search for it. It will be unique and you will get a single task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the CV.publish() task fails from raised exception, it does not return task_id as it normally would, the method returns None.
Do you know if there's some way to workaround this?

Copy link
Contributor Author

@damoore044 damoore044 Apr 29, 2024

Choose a reason for hiding this comment

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

@shweta83 Also tried asynchronous Publish, it also returns None once exception is raised/caught.
Instead I've updated to narrow the search scope, for just the publish task(s) with the desired cv.name and org.name.
Let me know if this addresses your suggestion!

Copy link
Contributor

Choose a reason for hiding this comment

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

task_search returns a task id which you can search in tasks and it will return a single task failed:
label='Actions::Katello::ContentView::Publish', output={}, pending=False, progress=1, result='error', started_at='2024-04-29 14:13:58 UTC', state='stopped', id='350e6a11-651b-408d-85df-09ea569296b1').

This id can be used to search that task

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in lines below, I get id from first entry in task_search, which returns like the output in your comment.
Then I poll that task by id and get failed output.
Am I missing something else or some other step for getting task id, other than ForemanTask.search()?

@damoore044 damoore044 force-pushed the RFE_reposync_publish branch from f44e21c to 56c58ae Compare April 29, 2024 13:05
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 29, 2024
@damoore044 damoore044 force-pushed the RFE_reposync_publish branch from 56c58ae to 85cf508 Compare April 29, 2024 13:09
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6725
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync --external-logging
Test Result : ================== 1 passed, 10 warnings in 747.40s (0:12:27) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 29, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6727
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync --external-logging
Test Result : =================== 6 warnings, 1 error in 60.78s (0:01:00) ====================

@Satellite-QE Satellite-QE added PRT-Failed Indicates that latest PRT run is failed for the PR and removed PRT-Passed Indicates that latest PRT run is passed for the PR labels Apr 29, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6728
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_contentview.py::TestContentViewPublishPromote::test_negative_publish_during_repo_sync --external-logging
Test Result : ================== 1 passed, 10 warnings in 852.01s (0:14:12) ==================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Apr 29, 2024
@vsedmik vsedmik merged commit 15101cf into SatelliteQE:master Apr 30, 2024
14 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 30, 2024
CI fix for CV publish tasks

(cherry picked from commit 15101cf)
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request. PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants