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

less flakiness in rex module #17519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pondrejk
Copy link
Contributor

@pondrejk pondrejk commented Feb 5, 2025

Problem Statement

Trying to make a couple of problematic tests behave more predictably.

Solution

Asserting for rex status instead of result, removing some time assertions

Related Issues

@pondrejk pondrejk added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Feb 5, 2025
@pondrejk pondrejk self-assigned this Feb 5, 2025
@pondrejk pondrejk requested a review from a team as a code owner February 5, 2025 14:24
@pondrejk
Copy link
Contributor Author

pondrejk commented Feb 5, 2025

trigger: test-robottelo
pytest: tests/foreman/cli/test_remoteexecution.py -k test_positive_run_scheduled_job_template

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10080
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_remoteexecution.py -k test_positive_run_scheduled_job_template --external-logging
Test Result : ========== 1 passed, 71 deselected, 84 warnings in 965.24s (0:16:05) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 5, 2025
@@ -882,7 +870,7 @@ def test_positive_time_expressions(self, rex_contenthost, target_sat):
)

@pytest.mark.tier3
@pytest.mark.rhel_ver_list([8])
@pytest.mark.rhel_ver_list([9])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.rhel_ver_list([9])
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])

Comment on lines 901 to +902
sleep(30)
assert_job_invocation_result(target_sat, invocation_command['id'], client.hostname)
assert invocation_info['status'] in ['running', 'finished', 'queued']
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of using sleep func here, why not use wait_for here to check if job-invocation is finished?

Copy link
Contributor

Choose a reason for hiding this comment

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

or wait_for_tasks.

Comment on lines -843 to -848
# 23 mins after every other hour
[
'23 0-23/2 * * *',
f'{today.strftime("%Y/%m/%d")} '
f'{(str(hour if hour % 2 == 0 else hour + 1)).rjust(2, "0")}:23:00',
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add some description/comments about this removals?

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.

Ack (Pending requested changes)

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 6.16.z Introduced in or relating directly to Satellite 6.16 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 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.

6 participants