tests: replace hard-coded sleep with a polling loop

This commit is contained in:
David Wilson 2018-06-10 01:00:12 +01:00
parent 4bd992e35a
commit df8fe59eda
1 changed files with 15 additions and 1 deletions

View File

@ -10,7 +10,21 @@
poll: 0
register: job
- shell: sleep 1
- assert:
that: |
job.ansible_job_id and
(job.changed == True) and
(job.started == 1) and
(job.changed == True) and
(job.finished == 0)
- name: busy-poll up to 100000 times
async_status:
jid: "{{job.ansible_job_id}}"
register: result
until: result.finished
retries: 100000
delay: 0
- slurp:
src: "{{ansible_user_dir}}/.ansible_async/{{job.ansible_job_id}}"