-
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
less flakiness in rex module #17519
Open
pondrejk
wants to merge
2
commits into
SatelliteQE:master
Choose a base branch
from
pondrejk:rex-flakex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
less flakiness in rex module #17519
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -819,7 +819,6 @@ def test_positive_time_expressions(self, rex_contenthost, target_sat): | |
""" | ||
client = rex_contenthost | ||
today = datetime.today() | ||
hour = datetime.now().hour | ||
last_day_of_month = monthrange(today.year, today.month)[1] | ||
# cronline uses https://github.com/floraison/fugit | ||
fugit_expressions = [ | ||
|
@@ -840,22 +839,11 @@ def test_positive_time_expressions(self, rex_contenthost, target_sat): | |
'@hourly', | ||
f'{(datetime.utcnow() + timedelta(hours=1)).strftime("%Y/%m/%d %H")}:00:00', | ||
], | ||
# 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', | ||
], | ||
# last day of month | ||
[ | ||
'0 0 last * *', | ||
f'{today.strftime("%Y/%m")}/{last_day_of_month} 00:00:00', | ||
], | ||
# last 7 days of month | ||
[ | ||
'0 0 -7-L * *', | ||
f'{today.strftime("%Y/%m")}/{last_day_of_month - 6} 00:00:00', | ||
], | ||
# last friday of month at 7 | ||
[ | ||
'0 7 * * fri#-1', | ||
|
@@ -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([settings.content_host.default_rhel_version]) | ||
def test_positive_run_scheduled_job_template(self, rex_contenthost, target_sat): | ||
"""Schedule a job to be ran against a host | ||
|
||
|
@@ -911,7 +899,7 @@ def test_positive_run_scheduled_job_template(self, rex_contenthost, target_sat): | |
invocation_info = target_sat.cli.JobInvocation.info({'id': invocation_command['id']}) | ||
pending_state = invocation_info['pending'] | ||
sleep(30) | ||
assert_job_invocation_result(target_sat, invocation_command['id'], client.hostname) | ||
assert invocation_info['status'] in ['running', 'finished', 'queued'] | ||
Comment on lines
901
to
+902
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or |
||
|
||
@pytest.mark.tier3 | ||
@pytest.mark.rhel_ver_list([8, 9]) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you add some description/comments about this removals?
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.
the next run calculation tends to be unstable in these cases, I think mainly because the expected value is calculated when building the list, but the jobs are run a bit later in the loop, so if the hour changes meanwhile the assertions won't match.