-
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
Remove sleeps and make cron expression more accurate #15172
Conversation
rigger: test-robottelo |
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.
Looks good to me, just added 2 non-blocking proposals. PRT pending.
tests/foreman/ui/test_syncplan.py
Outdated
next_sync = 5 * 60 | ||
# forming cron expression sync repo after 5 min | ||
expected_next_run_time = start_date + timedelta(seconds=next_sync) |
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 we don't use next_sync
later, could we go straight?
next_sync = 5 * 60 | |
# forming cron expression sync repo after 5 min | |
expected_next_run_time = start_date + timedelta(seconds=next_sync) | |
# forming cron expression sync repo after 5 min | |
expected_next_run_time = start_date + timedelta(minutes=5) |
tests/foreman/ui/test_syncplan.py
Outdated
next_sync = 5 * 60 | ||
# forming cron expression sync repo after 5 min | ||
expected_next_run_time = start_date + timedelta(seconds=next_sync) |
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.
Same here.
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.
What did you achieve by changing 3 minutes to 5?
Otherwise, LGTM.
Basically the UI test through navigation, and filling out different pages would take more than 3 minutes to add the product to the syncplan, which would mean the trigger for syncing would have already fired, and the product wouldn't get actually synced. 5 minutes seems to be (10 or 20 runs locally) to be consistent in giving enough time for the UI to process all the stuff, and still not be too long. |
trigger: test-robottelo |
PRT Result
|
* Remove sleeps and make cron expression more accurate * Use minutes instead of seconds variable (cherry picked from commit 75de548)
* Remove sleeps and make cron expression more accurate * Use minutes instead of seconds variable (cherry picked from commit 75de548)
@sambible That's funny when I run the downstream tests the polling is now failing because the ui is too fast :D |
* Remove sleeps and make cron expression more accurate * Use minutes instead of seconds variable
Problem Statement
The sleeps in these tests result in inconsistent behavior and the cron expression is malformed, leading to 2 seperate faliures. This PR will fix both.
Solution
Removed the sleep by setting max_tries to 20 on the task poll, reformatted the cron expression to always accurately set the sync time to 5 minutes after the plan is created. 5 minutes is required here due to slow interactions with the UI sometimes resulting in the product not being added until after the sync time had passed.
trigger: test-robottelo
pytest: tests/foreman/ui/test_contenthost.py -k 'test_positive_synchronize_custom_product_custom_cron_real_time'