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

Add some randomness to CV publish break down #14782

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Apr 15, 2024

Problem Statement

In CV eval it was suggested to add some randomness into the CV publish interruption so that we cover different phases of the publish task and go more real-life.

Solution

Add some sleep and few other adjustments.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/destructive/test_contentview.py

@vsedmik vsedmik added CherryPick PR needs CherryPick to previous branches 6.15.z Introduced in or relating directly to Satellite 6.15 labels Apr 15, 2024
@vsedmik vsedmik self-assigned this Apr 15, 2024
@vsedmik vsedmik requested a review from a team as a code owner April 15, 2024 19:07
@vsedmik
Copy link
Contributor Author

vsedmik commented Apr 15, 2024

trigger: test-robottelo
pytest: tests/foreman/destructive/test_contentview.py

).create()
try:
publish_task = cv.publish(synchronous=False)
sleep_time = random.randint(0, 60) # publish takes ~70s in 6.15 and SatLab VM
sleep(sleep_time)
target_sat.power_control(state='reboot', ensure=True)
Copy link
Contributor Author

@vsedmik vsedmik Apr 15, 2024

Choose a reason for hiding this comment

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

I wonder if mere f-m service restart wouldn't do the same job here (w/o need to spin AAP WF).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided to test that out with parametrization (second commit).

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6510
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_contentview.py --external-logging
Test Result : ================= 1 passed, 15 warnings in 1736.05s (0:28:56) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 15, 2024
).create()
try:
publish_task = cv.publish(synchronous=False)
sleep_time = random.randint(0, 60) # publish takes ~70s in 6.15 and SatLab VM
sleep(sleep_time)
Copy link
Member

Choose a reason for hiding this comment

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

Are we able to use wait_for task here? so if publish takes longer than normal we can still pass through?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually there is nothing specific we would wait for here. We just need to break the publish task in a random time while it's still running and check it succeeds later (after resume if needed). So we just need "wait for random time" which is done by that sleep.

Copy link
Contributor

@vijaysawant vijaysawant left a comment

Choose a reason for hiding this comment

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

Looks good, Ack 👍
Pending comment from @ColeHiggins2's review.

@omkarkhatavkar
Copy link

trigger: test-robottelo
pytest: tests/foreman/destructive/test_contentview.py

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6511
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_contentview.py --external-logging
Test Result : ================= 1 passed, 15 warnings in 1781.77s (0:29:41) ==================

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 16, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented Apr 16, 2024

trigger: test-robottelo
pytest: tests/foreman/destructive/test_contentview.py

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6512
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_contentview.py --external-logging
Test Result : ================= 2 failed, 207 warnings in 3031.43s (0:50:31) =================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Apr 16, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 30
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_contentview.py --external-logging
Test Result : ================= 2 failed, 192 warnings in 2914.47s (0:48:34) =================

def test_positive_reboot_recover_cv_publish(target_sat, function_entitlement_manifest_org):
@pytest.mark.parametrize('reboot', [True, False], ids=['vm_reboot', 'fm_restart'])
def test_positive_reboot_recover_cv_publish(
target_sat, module_sca_manifest_org, module_big_repos, reboot
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
target_sat, module_sca_manifest_org, module_big_repos, reboot
module_target_sat, module_sca_manifest_org, module_big_repos, reboot

module_big_repos is using module_target_sat and the test is using target_sat, seems like a mistake.
Same suggestion for the rest of the target_sat occurrences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, but I guess it won't help since we are a bit destructive here, so we get new Satellite for each test run here, which means we need new setup for each parametrized test which makes me cry and doubt if I really want to do the setup twice just to check the f-m restart.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay so it seems it did help, PRT passed.

@vsedmik
Copy link
Contributor Author

vsedmik commented Apr 16, 2024

trigger: test-robottelo
pytest: tests/foreman/destructive/test_contentview.py

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6516
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_contentview.py --external-logging
Test Result : ================= 2 passed, 210 warnings in 3263.49s (0:54:23) =================

@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 16, 2024
@vsedmik vsedmik requested a review from jameerpathan111 April 16, 2024 13:26
@jameerpathan111 jameerpathan111 merged commit 869694e into SatelliteQE:master Apr 16, 2024
10 of 11 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 16, 2024
* Add some randomness to CV publish break down

* Parametrize for f-m service restart too

(cherry picked from commit 869694e)
vsedmik added a commit that referenced this pull request Apr 17, 2024
Add some randomness to CV publish break down (#14782)

* Add some randomness to CV publish break down

* Parametrize for f-m service restart too

(cherry picked from commit 869694e)

Co-authored-by: vsedmik <[email protected]>
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
* Add some randomness to CV publish break down

* Parametrize for f-m service restart too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs 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.

8 participants