mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Cache tasks as they are queued instead of en masse (#34752)
* Cache tasks as they are queued instead of en masse This also moves the task caching from the PlayIterator to the StrategyBase class, where it makes more sense (and makes it easier to not have to change the strategy class methods leading to an API change). Fixes #31673 * Cleaning up unit tests due to 502ca780
This commit is contained in:
parent
b10d5f34ea
commit
b107e397cb
4 changed files with 51 additions and 63 deletions
|
@ -155,16 +155,6 @@ class TestPlayIterator(unittest.TestCase):
|
|||
all_vars=dict(),
|
||||
)
|
||||
|
||||
# lookup up an original task
|
||||
target_task = p._entries[0].tasks[0].block[0]
|
||||
task_copy = target_task.copy(exclude_parent=True)
|
||||
found_task = itr.get_original_task(hosts[0], task_copy)
|
||||
self.assertEqual(target_task, found_task)
|
||||
|
||||
bad_task = Task()
|
||||
found_task = itr.get_original_task(hosts[0], bad_task)
|
||||
self.assertIsNone(found_task)
|
||||
|
||||
# pre task
|
||||
(host_state, task) = itr.get_next_task_for_host(hosts[0])
|
||||
self.assertIsNotNone(task)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue