Add test for the pause in loop feature (#17336)
See https://github.com/ansible/ansible/pull/17289
This commit is contained in:
parent
8b3ae1e806
commit
e9ffe2062f
2 changed files with 21 additions and 1 deletions
|
@ -43,4 +43,4 @@
|
|||
- { role: test_embedded_module, tags: test_embedded_module }
|
||||
- { role: test_add_host, tags: test_add_host }
|
||||
- { role: test_binary, tags: test_binary }
|
||||
|
||||
- { role: test_loops, tags: test_loops }
|
||||
|
|
20
test/integration/roles/test_loops/tasks/main.yml
Normal file
20
test/integration/roles/test_loops/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
- name: Measure time before
|
||||
shell: date +%s
|
||||
register: before
|
||||
|
||||
- debug:
|
||||
var: i
|
||||
with_sequence: count=3
|
||||
loop_control:
|
||||
loop_var: i
|
||||
pause: 2
|
||||
|
||||
- name: Measure time after
|
||||
shell: date +%s
|
||||
register: after
|
||||
|
||||
# since there is 3 rounds, and 2 seconds between, it should last 4 seconds
|
||||
# we do not test the upper bound, since CI can lag significantly
|
||||
- assert:
|
||||
that:
|
||||
- '(after.stdout |int) - (before.stdout|int) >= 4'
|
Loading…
Reference in a new issue