Closed oshtaier closed 4 years ago
@swadeley pls look on that issue
Hello @oshtaier
I am working through and testing many of the sync plan tests because of the failure of future sync tests. I will change the test in #6793 first, but plan a few other changes to make tests consistent where possible.
@swadeley whatever works for you and what is most effective way
Hello
In ./robottelo/api/utils.py
I changed this line while testing:
- time.sleep(2)
+ time.sleep(20)
it saves spamming the logs. Should I make that permanent?
I am not sure that is good idea as that can force system wait for unnecessary time (like something happened in 2 seconds and you wait 18 seconds more for no reason)
The changes to make the other tests consistent are in https://github.com/SatelliteQE/robottelo/pull/6825
robottelo]$ pytest --capture=no tests/foreman/api/test_syncplan.py::SyncPlanSynchronizeTestCase 2019-04-03 21:48:16 - conftest - DEBUG - Registering custom pytest_namespace
======================== test session starts =================================== platform linux -- Python 3.6.6, pytest-4.0.2, py-1.6.0, pluggy-0.8.1 shared_function enabled - OFF - scope: - storage: file rootdir: /Downloads/robottelo, inifile: plugins: xdist-1.23.2, services-1.3.1, repeat-0.8.0, mock-1.10.0, forked-0.2, cov-2.6.0 collecting ... 2019-04-03 21:48:17 - conftest - DEBUG - BZ deselect is disabled in settings
collected 8 items
===================== 8 passed, 4 warnings in 1924.71 seconds ========================
oops, that comment above should have been in the pull request
Hello
After some testing and reading how the sync plan create code works, I have added a line to make sync plans that are "custom cron" not generate a random cron expression but rather use the supplied expression (every 4 minutes). That way the first multiple of 4 minutes, counting from 00 minutes on the clock, that occurs after the start time will be the sync event the test is looking for. So as the test is configured now, with a delay time of 5 mins, that would be anything from 5 to 9 minutes ahead. The test can cope with this time window as it checks for max ten minutes for the existence of the pulp repo which signals the sync task has started.
Thank you
robottelo]$ for i in {1..6}; do echo $i; pytest --dist=each --tx=3*popen --show-capture=no tests/foreman/cli/test_syncplan.py::SyncPlanTestCase::test_positive_synchronize_custom_product_future_sync_date; done 1 ============================ test session starts ====================== platform linux -- Python 3.6.6, pytest-4.0.2, py-1.6.0, pluggy-0.8.1 shared_function enabled - OFF - scope: - storage: file rootdir: /Downloads/robottelo, inifile: plugins: xdist-1.23.2, services-1.3.1, repeat-0.8.0, mock-1.10.0, forked-0.2, cov-2.6.0 gw0 [1] / gw1 [1] / gw2 [1] scheduling tests via EachScheduling . [100%].. [100%] [100%]
Look in https://github.com/SatelliteQE/robottelo/pull/6793 for details. Maybe, we can think about even better idea