-
Notifications
You must be signed in to change notification settings - Fork 115
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
Conversation
trigger: test-robottelo |
PRT Result
|
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()
?
f44e21c
to
56c58ae
Compare
trigger: test-robottelo |
56c58ae
to
85cf508
Compare
trigger: test-robottelo |
PRT Result
|
trigger: test-robottelo |
PRT Result
|
PRT Result
|
CI fix for CV publish tasks (cherry picked from commit 15101cf)
…eQE#14890) CI fix for CV publish tasks
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].
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